If it equals?

Trevor DeVore trevor at mangomultimedia.com
Thu Aug 22 11:20:01 CDT 2002


This is the most efficient way but you could use a repeat loop do go through each line of the file.  Use open file and read from file to get the data into a variable then loop through each line comparing the entered name to the login name.  If you only had one name per line then the loop might look like this:

repeat i = 1 to the number of lines in myFile
  if loginname is equal to line i of myFile then
    -- the login name exists
    -- do stuff here
    exit repeat
  end if
end repeat

Hopefully this will get you started.
    
    

>Hello,
>    I am trying to make a easy Log-In system. I have a big list of Names in a Text file. What I want it to do, 
>when you enter your name to Log-In, it will check the text file to make sure that name is in the Text File, if 
>not, it won't let you log in. I don't know how to come about on doing this. Any ideas how to do this? Thanks!
>
> - Josh Dye



More information about the use-livecode mailing list