Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hate Nested IFs? Consider this...
Message
 
 
À
12/01/2006 15:46:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01086217
Message ID:
01086305
Vues:
24
>
>SELECT c_letter_series_masters
>DO CASE
>   CASE myLookup("cDepartment_code=lcDepartment_code AND cClient_code=lcClient_hospital_id")
>      lcLetter_series_masters_pk = c_letter_series_masters.cLetter_series_masters_pk
>      llFound = .T.
>   CASE myLookup("cDepartment_code = lcDepartment_code")
>      lcLetter_series_masters_pk = c_letter_series_masters.cLetter_series_masters_pk
>      llFound = .T.
>   CASE myLookup("cClient_code = lcClient_hospital_id")
>      lcLetter_series_masters_pk = cLetter_series_masters_pk
>      llFound = .T.
>   OTHERWISE
>      =MESSAGEBOX("Nothing found")
>      llFound = .F.
>ENDCASE
>
>
>FUNCTION myLookup
>LPARAMETERS tcLookup
>LOCATE FOR EVAL(tcLookup)
>RETURN FOUND()
>
>

LOL. I should have said without using functions. Also would you agree that this change would slow the code execution considerably if you're running this code in a loop? <g>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform