XFIR8.39VMpami,:pamm8( XFIR8.pami ?!pamm8,E!*YEKltSACj(tSACtSAC1ltSACFCRDTpeerf *SACXtcL6knuj.' knuj&'fniC<SREV 6'manLV&rcsLrcsLBrcsL"rcsL|$muhTJ'muhT)muhT*muhT,*YEK  muhTmuhTmuhTmuhT *SACfniCFCRD XtcLSREVSREVSREV  lccFCRDTT::V<w`fniC< Y*SACtSACj \------------------------------------------------------------- --This script must be set as a "movie script" to work --it first declares a global variable called "myFile" --then uses myFile as the call to make a new fileIO instance. ------------------------------------------------------------- global myFile on startMovie myFile = new(xtra "fileio") end on stopMovie myFile = 0 -- Dispose of the instance end File I/O StarterVSD,8P?H. .tSAC !!!!555555IIIIIIIMQ --this behavior saves the contents of mySaveString (your results), to a text file you specify --the handler appends text to a text file of your choice. It also adds various returns and seperation lines in the results as well. global myFile on mouseUp if objectP(myFile) then set myFile = 0 -- Delete any old FileIO instances if they already exists ----------------------------------- -- Put the text fields you want to save in the varable below (include descriptions, returns and septeration lines for readability). The returns are done by including an off screen text box with a return in it. In this example the hidden return field is named "r". You must also make sure that the strings are all one continuous line or you will get an error. --Notice that I am starting out with a return as well to give the entries some breathing room. mySaveString = member("r").text &"------------------------------"& member("r").text &"--Yellow's answer--" & member("r").text & member("Y").text & member("r").text & member("r").text & "--multi choice--" & member("r").text & member("multichoice").text -- check for empty fields optional if member("y").text ="" then alert "Try to enter some idea for every field, even if you are not 100% sure. Alot of first ideas end up being the best ones and you can always change them later." exit end if ------------------------------ --The following opens and appends to the ongoing file specified in openFile myFile = new(xtra "fileio") -- Create a new instance/call to the FileIO openFile(myfile, "c:\info.rtf",0) --Open the file with R/W access "0" if readFile(myFile)=VOID then --checks to see if this file exists alert "You need to submit some answers before appending to them" --alerts if the variable returned VOID end if setPosition(myfile,getLength(myFile)) -- Set position to end of the file writeString(myFile, mySaveString) -- Append text to the file closeFile (myfile) -- Closes the file myFile = 0 -- Dispose of the instance endAppend & Save To RTF File%",?H. .tSAC1 #t ---------------------------------------------------------------------------------- --this behavior saves the contents of your mySaveString (your results), to a text file you specify --If you have a file with the same name in the same location, it will over write it. ---------------------------------------------------------------------------------- global myFile on mouseUp if objectP(myFile) then set myFile = 0 --Delete the instance if it already exists myFile = new(xtra "fileio") -- Create an instance of FileIO openFile (myFile, "c:\info.rtf",0)--Open the file with R/W access "0" delete(myFile) --deletes old file createFile (myFile, "c:\info.rtf") --creates the file again openFile(myFile,"c:\info.rtf",0) --Open the file with R/W access "0" -------------------------------------- -- Put the text fields you want to save in the variable below (include descriptions, returns and septeration lines for readability). The returns are done by including an off screen text box with a return in it. In this example the hidden return field is named "r". You must also make sure that the strings are all one continuous line or you will get an error. --Notice that I am starting out with a return as well to give the entries some breathing room. mySaveString = "--Yellow's answer--" & member("r").text & member("Y").text & member("r").text & member("r").text & "--multi choice--" & member("r").text & member("multichoice").text -- check for empty fields optional if member("o").text ="" then alert "Try to enter some idea for every field, even if you are not 100% sure. Alot of first ideas end up being the best ones and you can always change them later." exit end if ------------------------------ writeString(myFile,mySaveString) --writes text to the file closeFile(myFile) -- Close the file myFile = 0 -- Dispose of the instance end Write to a RTF File ~Z,?H. .tSAC y -------------------------------------------------------------------- --this handler displays the text in the file specified below. --if the file has not been created it will display an alert -------------------------------------------------------------------- global myFile on mouseUp if objectP(myFile) then set myFile = 0 --Delete the instance if it already exists myFile = new(xtra "fileio") -- Create an instance of FileIO openFile(myFile,"c:\info.rtf",1) --Open the file with read access only "1" myVariable = readFile(myFile) --set the variable 'myVariable' to the text of the file 'info.txt' if readFile(myFile)=VOID then --checks to see if this file exists alert "You need to submit some answers before trying to read them" --alerts if the variable returned VOID else member("results").text = myVariable -- display the text that has been saved so far closeFile(myFile) -- Close the file end if myFile = 0 -- Dispose of the instance end Read RTF File%",?H. .XtcL` !?!?$!?!>rcsL\ \\^  B w DCWCWO OfileiorcsLBBB\>\\^ jtFFH!HICWODCWaD DCWa D DCWa DCWa DCWa DCWa D DCWa DCWa RDCWaD DBW D CWCWOID BW ICW CW  D BW IICWBW ILBWIBWO R  *BH^ntz&6r--------------------------------Yellow's answer--Y--multi choice-- multichoiceyTry to enter some idea for every field, even if you are not 100% sure. Alot of first ideas end up being the best ones and you can always change them later.fileio c:\info.rtf9You need to submit some answers before appending to themrcsL\\\^ F((*x*ICWODCWCWOIDBW IBWIDBWIDBW DDCWa DCWa DCWa DCWa D DCWa DCWa RDCWaD D BW ILBWIBWO  = 4:@Vflrfileio c:\info.rtf--Yellow's answer--rY--multi choice-- multichoiceoTry to enter some idea for every field, even if you are not 100% sure. Alot of first ideas end up being the best ones and you can always change them later.rcsL|||\x\\^hU ICWODCWCWOIDABW ICW RICW CW  DBW DCWLbIBWO   \fileio c:\info.rtf;You need to submit some answers before trying to read themresultsmanL startMovie stopMoviemyFilenewxtramouseUpobjectpmembertextalertopenFilereadFilevoid setPosition getLength writeString closeFile mySaveStringdelete createFile myVariable lccpamFSREV AmuhT %%%%%%%%%%%%%P%%%%%%%%%%%%%%VV%%% VVVV%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%P%%%%%%%%%%%%%%%%%muhT ++++U++++~++++V+V+++++V+++V+VV+++++V+V+V++++V++ +V+V+++V+V++++V++++++V++V+++V++++V++++++++++++ ++V++++++ V+V++++++ +V++++++ ++V++++++ ++++++++++++++++muhT ++U++++~+++V++++++V+++V++VVV++V+++V++++++++V+++++++++++++++++++++++ ++V++++++ V+V++++++ +V++++++ ++V++++++ ++++++++++++++muhT ++U++++~+++++++V+V++++++++V++++++VV+++++++++++++++++++ ++V++++++ V+V++++++ +V++++++ ++V++++++ ++++++++++++++