Amy Jorgensen wrote:
> Hi everyone, > > We are new to Authorware (2 months) and having a lot of trouble getting the > ReadExtFile to work. What we need to do is read a file containing text > data. It is saved in Notepad. The WriteExtFile and AppendExtFile works but > we can't get the Read. > > Scenerio: The student will enter login information. This information needs > to match what is in the Notepad text file and if it matches continue if not > go back to login procedure. I don't know how to set up the notepad file so > that Authorware can read it? What is wrong in the logic of my code? Any > help is greatly appreciated. > > UserData:= ReadExtFile("E:\\StudentFiles" ^"students.txt")
You need to add the delimiter between "...StudentFiles" and "students.txt", e.g.: UserData:= ReadExtFile("E:\\StudentFiles\\students.txt") OR delim :="\\" UserData:= ReadExtFile("E:\\StudentFiles" ^delim ^ "students.txt")
Also, hardcoding the drive letter "E:" may be dangerous. Is the drive ALWAYS going to be "E" or could it be something else? If it could be something else you want to determine the drive letter based on FileLocation or use a KO, WinAPI, or BudAPI to get the drive letter.
> > repeat with X:=1 to LineCount(UserData)
Your repeat loop should be: repeat with X = 1 to LineCount(UserData) --take out the colon( : )
> > > FileLine := GetLine(UserData, X) --gets the data of Students text file > EvalAssign(FileLine) > end repeat > > if FileLine <> Rank ^"\r"& First ^"\r"& Last ^"\r"& CName then > GoTo(IconID@"DeletedIcon") > end if >
You're not going to go anywhere by going to a deleted icon. But I'm not going to lecture you about using GoTo - someone else is sure to do it.
> > Here is what my Notepad file looks like: > > General<tab>Lesley<tab>Holbert<tab>01-01<return> > > Thanks, Amy > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > -- > The AWARE List > http://www.e-media.nl/aware/index.html > > Search the Archives > http://www.e-media.nl/aware/search.html > > Netiquette: > - Use descriptive subject fields > - Use subject prefixes (A5 , A5Mac , A5Web , KO , UCD , OT) > > >
-- The AWARE List http://www.e-media.nl/aware/index.html
Search the Archives http://www.e-media.nl/aware/search.html
Netiquette: - Use descriptive subject fields - Use subject prefixes (A5 , A5Mac , A5Web , KO , UCD , OT)