Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Progressive llRetVal check and code execution
Message
From
28/11/2005 08:40:55
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01072377
Message ID:
01072394
Views:
20
Yes, Viv. That's another possibility I would use that if speed were an issue.

I tend to use the case as it is easier to debug (assert). It tells you exactly where things went wrong. But then, it's personal taste
_________________
>Hi,
>Maybe :
>
>LOCAL llRetVal
>IF DODFAULT() ;
>  .AND. THISFORM.pgf.Page1.txtIno.CheckForBadNextNo() ;
>  .AND. etc...
>  llRetVal = .T.
>ENDIF
>RETURN llRetVal
>
>
>
>
>>>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.
>>
>>Hi,
>>
>>This is what I use most of the times. One entry, one exit. And easier to debug
>>
>>
>>local Success
>>Success = TRUE
>>
>>do case
>>case !m.Success
>>
>>case !DoDefault()
>>    assert FALSE
>>    Success = FALSE
>>
>>case !THISFORM.pgf.Page1.txtIno.CheckForBadNextNo()
>>     assert FALSE
>>    Success = FALSE
>>
>>.....
>>
>>endcase
>>
>>return m.Success
>>
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform