Hi,
Sorry, I meant to post my suggestion to Bhavbhuti. I notice that the other repsonses so far have suggested the same approach as me but, in fact, I think you're right - I like your approach better...
Best,
Viv
>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
>>>