Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
If, then, else
Message
De
11/03/1997 15:18:54
 
 
À
11/03/1997 15:12:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00023771
Message ID:
00023772
Vues:
26
>Watching this code in the debugger reveals that even when seek evaluates to false, the else clause in not executed. Am I forgetting something? I have had this problem before and band-ais fixed it with separate 'if' statements.
>
>if seek(my_name) = .T. then
> if passwords.password = my_password then
> messagebox(greeting, 0,"Log")
> do login
> thisform.release
> endif
>else messagebox("Invalid Login Attempt", 0, "Invalid")
>endif

Maybe you can try to simplify it a little bit. There is also no need to have then nor to put the command in the same line as the else.
if seek(my_name)
   if passwords.password = my_password
      messagebox(greeting, 0,"Log")
      do login
      thisform.release
   endif
   else
   messagebox("Invalid Login Attempt", 0, "Invalid")
endif
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform