using repeat loops to add info
Posted: Sat Sep 29, 2012 8:34 pm
Hi,
I've randomized the numbers 1-12. I'm trying to use the random numbers one at a time to put information into a different bin (i.e., if the first number is 6, I want to put the information in card field "6" into bin1; if the second number is 4, I want to put the information in card field "4" into bin2, etc.). I need to do this for all 12 numbers.
This code doesn't work:
sort lines of card field "randombin" of card "orders" by random(12) #sorts my numbers
repeat with x = 1 to 12
put item 1 of line x of card field "randombin" of card "orders" into y
put card field y of card "main task materials" into matlist(x) <-------------------How can I use the "x" in the repeat loop to add 1(so that it starts with matlist1, then matlist2, etc....)
end repeat
I've randomized the numbers 1-12. I'm trying to use the random numbers one at a time to put information into a different bin (i.e., if the first number is 6, I want to put the information in card field "6" into bin1; if the second number is 4, I want to put the information in card field "4" into bin2, etc.). I need to do this for all 12 numbers.
This code doesn't work:
sort lines of card field "randombin" of card "orders" by random(12) #sorts my numbers
repeat with x = 1 to 12
put item 1 of line x of card field "randombin" of card "orders" into y
put card field y of card "main task materials" into matlist(x) <-------------------How can I use the "x" in the repeat loop to add 1(so that it starts with matlist1, then matlist2, etc....)
end repeat