Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Progressive llRetVal check and code execution
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01072377
Message ID:
01072385
Vues:
13
This message has been marked as the solution to the initial question of the thread.
>Hi
>
>I have this code snippet, lots in fact, where the code goes something like this:
>
LOCAL llRetVal
>
>llRetVal = DODEFAULT()
>
>IF llRetVal
>	llRetVal = THISFORM.pgf.Page1.txtIno.CheckForBadNextNo()
>
>	IF llRetVal
>...
>	ENDIF
>ENDIF
>
>RETURN llRetVal
>
>Any suggestion where the code can be more linear.
>
>Or do I RETURN as soon as I get a false value?
>Or do I IF Condition()?
>
>Please advise.

It dependes of what you want. If you want to exit immidiately after you get .f. for returning value then issue RETURN .f. what the condition is not satisfied. If you want to perform full test and then return .f. you can do:

That way you perform ALL tests no metter what is not satisfied
llRetVal = DODEFAULT()
llRetVal = llRetVal AND THISFORM.pgf.Page1.txtIno.CheckForBadNextNo()
llRetVal = llRetVal AND SecondCondition()
RETURN llRetVal
That way check stop after first .f. condition from left to right.
llRetVal = DODEFAULT()                                   AND;
           THISFORM.pgf.Page1.txtIno.CheckForBadNextNo() AND;
           THISFORM.SecondCondition()

RETURN llRetVal
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform