Looping through sets in order

Kristy Kugler brennalarpista at hotmail.com
Fri Aug 9 15:28:01 EDT 2002


Hi all, I'm working on a quizzing program that takes its data from external 
files.  When a user goes through for the first time, it automatically sends 
them to the first question set.  However, when the user goes through again 
(any number of times), I need it to go directly to the next question set.  
Right now, it's random, and the first part looks like this:

switch
case (SavedUserData contains "SFQuiz1Passed")
  if SavedUserData contains "SFQuiz1Passed" then
      put random(4) into fileNum
get URL ("file:data/SFQuizzes/SFQuiz1/Instructions" & fileNum & ".txt")
  repeat for 3 times
    if it is empty then
    subtract 1 from fileNum
get URL ("file:data/SFQuizzes/SFQuiz1/Instructions" & fileNum & ".txt")
          put it into fld "instructions"
        else put URL ("file:data/SFQuizzes/SFQuiz1/Instructions" & fileNum & 
".txt") into fld "instructions"
        end if
      end repeat


Now, this works, but I want to change it so it remembers what question set 
has been completed and then does the next one, looping back to the beginning 
when it has been completed.  It also needs to look for a file with 
information, because not all the quizzes have the same amount of question 
sets.

I know I need to write the information to an external file, to be called 
upon when the user goes through again, but what do I need to do to let the 
program recognize which set it's been through?  After that, I just need to 
do something like "put "Thisthing" + 1 into fileNum" right?

I hope this makes sense.  Thanks for the help!  It's invaluable.

Kristy Kugler


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com




More information about the use-livecode mailing list