If it equals?
Zzyzx at Relia.Net
Thu Aug 22 15:24:01 EDT 2002
Found out that it is Not searching all of the lines. Here is the script.
put URL "file:\\ZZYZX\INTERFACE\Names.txt" into fld "NamePass"
set the itemdel to TAB
put fld "NamePass" into the_file
put empty into fld "NamePass"
ask "Please enter your Registered Alias"
if it is empty then exit mouseup
put it into the_user
repeat for each line 1 in the_file
if item 1 of 1 is the_user then
put item 2 of 1 into the_password
answer "Sorry, that Name is not in the User Database. Pelase check
ask password "Please enter your Case Senstive Password"
if it is the_password then
put "Logged In As: " & the_user into fld "LOG"
show btn "LOG OFF"
send RateM to this stack
enable btn "Games"
answer "Sorry, the Entered Password was Incorrect. Pelase try again" &
Return & "If you feel this has come to you in Error, Please remember that
the Passwords are Case Senstive."
It works. But, it is not searching all of the lines. It only works for the
first line. Any ideas how to get it to search all of the lines?
- Josh Dye
----- Original Message -----
From: "Klaus Major" <k_major at os.surf2000.de>
To: <use-revolution at lists.runrev.com>
Sent: Thursday, August 22, 2002 12:32 PM
Subject: Re: If it equals?
> Hi Josh,
> you terminate the "repeat"-loop at the wrong place if your script is
> what you are using.
> > Hello,
> > I can't quite get it to work. Here is the script that I have so far.
> > local the_user
> > local the_password
> ## declaring these vars as local is not really necessary
> ## a var is valid (and thus usable) in a complete handler.
> ## in this case from "on mouseup" until "end mouseup"
> > on mouseup
> > set the itemdel to TAB
> ### i recommend this
> put URL "file:\\ZZYZX\INTERFACE\Names.txt" into the_file
> > ask "Who the hell are YOU ???"
> > if it is empty then exit mouseup
> > put it into the_user
> > repeat for each line l in the_file
> > if item 1 of l is the_user then
> > put item 2 of l into the_password
> > exit repeat
> > else
> > answer "heavy complaining..."
> > exit mouseup
> > end if
> end repeat ## !!! here is the right place to end that loop ;-)
> > ask "Please enter more money ehmm your password"
> > if it is the_password then
> > answer "do_the_right_thing"
> > else
> > answer "heavy complaining... again"
> > end if
> > ### end repeat
> ## !!!
> > end mouseup
> > The text file reads this so far...
> > Dr.Zzyzx TAB jOU~f1b.
> > Kolok
> > I can't get it to work. So any problems?
> > - Josh Dye
> Hope this helps...
> Klaus Major
> k_major at os.surf2000.de
> use-revolution mailing list
> use-revolution at lists.runrev.com
More information about the Use-livecode