Random Variable in a column
Posted: Sun Dec 15, 2013 1:21 pm
I'm trying to find a way to assign a random column to display in a text field after I assign mouseUp to a button. So right now this is my code to display the random variable for the row but I only know how to assign one column.
put the dgDataOfLine[random(22)] of grp "WordsChart" of stack "FWsub" into FirWord
put FirWord["Nouns"] into FirWordValue
put FirWordValue into field "FirstWord" <--- that is the text field that displays the word
So on mouseUp, I click the button and it puts a random number into FirWord. It then assigns the column "Nouns" into FirWordValue. The word that is assigned to this cell that is the random number and in column "Nouns" is then displayed. What can I do to assign a random column instead? All my columns are named and I have eight of them.
put the dgDataOfLine[random(22)] of grp "WordsChart" of stack "FWsub" into FirWord
put FirWord["Nouns"] into FirWordValue
put FirWordValue into field "FirstWord" <--- that is the text field that displays the word
So on mouseUp, I click the button and it puts a random number into FirWord. It then assigns the column "Nouns" into FirWordValue. The word that is assigned to this cell that is the random number and in column "Nouns" is then displayed. What can I do to assign a random column instead? All my columns are named and I have eight of them.