If it equals?

Klaus Major k_major at os.surf2000.de
Thu Aug 22 12:37:01 EDT 2002


Hi all,

> as usual, a repeat loop with "for each" will be incredibly faster.
>
> Just in case the userbase will grow you could script:
> (Presumed that the lines are in this format: username TAB coded 
> password)
>
> ...
> set the itemdel to TAB
> repeat for each line l in myFile
>    if item 1 of l is the_user then
>     put item 2 of l into the_password
>     exit repeat
>   end if
> ask "Please enter more money ehmm your password"
> if it is the_password then
>   do_the_right_thing
> end if
> ...
>
> "for each" can process up to thousands of lines in a fraction of a 
> second !
> No foolin' ;-)
>
> Hope that helps...
>
>
> Regards
>
> Klaus Major
> k_major at os.surf2000.de

that's nice but bullshi ;-)

Sorry...

Here we go:

on mouseup ## or whatever
   set the itemdel to TAB
   ask "Who the hell are YOU ???"
   if it is empty then exit mouseup
   put it into the_user
   repeat for each line l in myFile
      if item 1 of l is the_user then
        put item 2 of l into the_password
        exit repeat
    else
       ## heavy complaining...
       exit mouseup
     end if
  ask "Please enter more money ehmm your password"
  if it is the_password then
     ### do_the_right_thing
  else
  ## heavy complaining...
  end if
end mouseup




More information about the Use-livecode mailing list