Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ICASE() alternative
Message
From
22/01/2019 14:28:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/01/2019 10:19:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01665620
Message ID:
01665639
Views:
59
If you don't want to use ICASE() or multiple IIF() version the the same thing could also be written as:
LOCAL test1, test2
* Change these values to see how it works with each
test1 = .f.
test2 = .f.

= (m.test1 and match1(@lnVar1, @lnVar2)) OR ;
   (m. test2 and match2(@lnVar1, @lnVar2)) OR ;
   nomatch(@lnVar1, @lnVar2))

? m.lnVar1, m.lnVar2
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform