Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hate Nested IFs? Consider this...
Message
 
 
To
12/01/2006 15:46:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01086217
Message ID:
01086305
Views:
22
>
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform