Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Progressive llRetVal check and code execution
Message
De
28/11/2005 09:18:20
 
 
À
28/11/2005 08:40:55
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:
01072420
Vues:
12
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
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform