I want to create a random statement that will create one string by picking a random element from array1 followed by a random element from array2. Can you help me?
array1 = ["AL", "AK", "AZ", "AR", "CA" ......] (51 elements total)
array2 = ["S" "M" "T" "W" "F"] (5 elements total)
Posts: 1,769
Threads: 410
Joined: Feb 2003
you may have a function called "uniform" in your version of QM (if not search the forum for it); it will give you a random number from limits you set and you can use it to get the value from the first and another one for the second array.
sorry cant code if for you; im really weak at arrays.
Ken
Posts: 12,135
Threads: 142
Joined: Dec 2002
ARRAY(str) a1 a2
a1="AL[]AK[]AZ[]AR[]CA"
a2="S[]M[]T[]W[]F"
str s.from(a1[Uniform(0 a1.ubound)] a2[Uniform(0 a2.ubound)])
out s
It says Uniform is unknown identifier.
Posts: 12,135
Threads: 142
Joined: Dec 2002
Create new function (not macro), name it Uniform (must match case), paste code from
http://www.quickmacros.com/forum/showthread.php?tid=77