Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ICASE() alternative
Message
From
22/01/2019 10:19:54
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
ICASE() alternative
Miscellaneous
Thread ID:
01665620
Message ID:
01665620
Views:
94
Does anyone know another way to do this? I want to set multiple values (two in this case) in an ICASE() based on the one matched condition.
LOCAL lnVar1, lnVar2
LOCAL test1, test2

* Change these values to see how it works with each
test1 = .f.
test2 = .f.

ICASE(test1, match1(@lnVar1, @lnVar2), ;
      test2, match2(@lnVar1, @lnVar2), ;
      nomatch(@lnVar1, @lnVar2))

? lnVar1, lnVar2



FUNCTION match1
LPARAMETERS tnVar1, tnVar2
    tnVar1 = 1
    tnVar2 = 2
ENDFUNC



FUNCTION match2
LPARAMETERS tnVar1, tnVar2
    tnVar1 = 10
    tnVar2 = 20
ENDFUNC



FUNCTION nomatch
LPARAMETERS tnVar1, tnVar2
    tnVar1 = -1
    tnVar2 = -2
ENDFUNC
Next
Reply
Map
View

Click here to load this message in the networking platform