Loading random files

Mark Smith mark at maseurope.net
Tue Mar 11 09:26:59 EDT 2008


Alan, if you have a list of files, words or anything else, for that  
matter, called 'tList"

put any line of tList into tFile

will choose a line at random.

However, bear in mind that the choices are not guaranteed to be ones  
not already made, so you may want to do something like this:

put random(the number of lines in tList) into tLine
put line tLine of tList into tFile
<do something with tFile>
delete line tLine of tList -- make sure it doesn't get chosen again

Best,

Mark

On 24 Jan 2008, at 20:45, Alan Nielsen wrote:

> I'm working on an experimental design in which figures will be  
> displayed,
> and the subjects given a choice of two words to describe the figure.
>
> The figures, and words however, have to be randomly selected from my
> database of figures and words
>
> How would I go about having a new random figure loaded in a figure  
> window
> everytime a stack opened? Obviously, the same thing is needed for  
> words;
> can I have a button display a random word from a list of words?
>
> Cheers
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the Use-livecode mailing list