switching which external files to use

Kristy Roggio brennalarpista at hotmail.com
Thu Jul 18 16:18:01 EDT 2002


Hi, I'm a newbie to the list, and I have a question.  I'm trying to finish 
up a quizzing program, and my data is all stored in different external files 
so it can be changed after it is turned into a standalone.

Right now, I'm using a switch command that recognizes if the user has 
completed and passed/failed the quiz.  It looks like this:

on OpenCard
  global answerChosen,numberMiss,numberCorrect,SavedUserData
  switch
  case (SavedUserData contains "SFQuiz1Passed")
    put URL "file:data/SFQuizzes/SFQuiz1/Instructions2.txt" into fld 
"instructions"
    put URL "file:data/SFQuizzes/SFQuiz1/Answers2.txt" into fld "answers"
    get URL "file:data/SFQuizzes/SFQuiz1/questions2.txt"
    set the questions of group "quesControl" to URL 
"file:data/SFQuizzes/SFQuiz1/questions2.txt"
    get URL "file:data/SFQuizzes/SFQuiz1/corrAnswers2.txt"
    set the corrAnswers of group "quesControl" to URL 
"file:data/SFQuizzes/SFQuiz1/corrAnswers2.txt"
    break
  case (SavedUserData contains "SFQuiz1Failed")
    put URL "file:data/SFQuizzes/SFQuiz1/Instructions2.txt" into fld 
"instructions"
    put URL "file:data/SFQuizzes/SFQuiz1/Answers2.txt" into fld "answers"
    get URL "file:data/SFQuizzes/SFQuiz1/questions2.txt"
    set the questions of group "quesControl" to URL 
"file:data/SFQuizzes/SFQuiz1/questions2.txt"
    get URL "file:data/SFQuizzes/SFQuiz1/corrAnswers2.txt"
    set the corrAnswers of group "quesControl" to URL 
"file:data/SFQuizzes/SFQuiz1/corrAnswers2.txt"
    break
  default
    put URL "file:data/SFQuizzes/SFQuiz1/Instructions.txt" into fld 
"instructions"
    put URL "file:data/SFQuizzes/SFQuiz1/Answers.txt" into fld "answers"
    get URL "file:data/SFQuizzes/SFQuiz1/questions.txt"
    set the questions of group "quesControl" to URL 
"file:data/SFQuizzes/SFQuiz1/questions.txt"
    get URL "file:data/SFQuizzes/SFQuiz1/corrAnswers.txt"
    set the corrAnswers of group "quesControl" to URL 
"file:data/SFQuizzes/SFQuiz1/corrAnswers.txt"
  end switch
  end OpenCard

Now, this is great if I only have 2 different sets...the originals and the 
"2" set.  How do I tell it to cycle through the next set of external files?  
Can I use a repeat cycle to insert the info from "/Instructions3.txt" and 
the rest of those txt files the next time the user wants to take that quiz?  
How do I automatically change which question set files are being accessed?  
I hope my question makes sense, and any help would be a life saver.

Thanks,

Kristina Kugler

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx




More information about the Use-livecode mailing list