Random Questions?

TJ Frame tjframe at gmail.com
Sat Oct 1 07:37:06 EDT 2005


If I understand your question correctly, I think one way to do what you want
is:
  on opencard
put item ( random(the number of items of fld "ranName")) of fld "ranname"
into field "Question"
end opencard
 as for using items - by default Rev uses commas as item delimiters, but you
can set tah to anything you want.
 for example :
 put the itemdel into oldDelim -- stores old delimiter
set the itemdel to "^"
-- do stufff
 set the itemdel to oldDelim --- reverts to old delimiter

thus you can seperate your blocks of text with some strange character and
use that as the itemdelimiter and you should be good to go.
 - TJ
  On 10/1/05, SupermanSlyr at aol.com <SupermanSlyr at aol.com> wrote:
>
> I'm trying to make a testing program that inserts random questions into a
> field when the card is open. I was not sure exactly how to go about doing
> this.
> This is what I tried to do. I put a field on each card with a few names on
> it, just to see if I had the random thing down. The I made the field
> invisible.
> I tried to scripted the card to:
>
> On opencard
> get random(item 1 of field "ranName")
> put it into field "Question"
> end opencard
>
> (I know I said the field has names in it. I just wanted to see if I could
> get random text this way before I went nuts adding long questions.)
>
> Also I'm still not 100% sure how (even if the above did work) to make the
> question occupy more than just one line of text. I assume I'd have to use
> "item" and maybe a chunk operation? Because I wasn't sure how Revolution
> knows
> when an item begins, and when it ends. I just want to make a simple
> testing
> program that doesn't always give the same questions. I know the answer is
> probably very simple, and right under my nose again.
>
> Thank all of you very, very much!
> _______________________________________________
> 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