Task

Using two Arrays of equal length, create a Hash object
where the elements from one array (the keys) are linked
to the elements of the other (the values)



Related task

   Associative arrays/Creation


 
# Project : Hash from two arrays
 
list1="one two three" 
list2="1 2 3"
a = str2list(substr(list1," ",nl))
b = str2list(substr(list2," ",nl))
c = list(len(a))
for i=1 to len(b) 
     temp = number(b[i])
     c[temp] = a[i]
next 
for i = 1 to len(c)
     see c[i] + " " + i + nl
next
 