Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Progressive llRetVal check and code execution
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01072377
Message ID:
01072385
Views:
14
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform