Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ICASE() alternative
Message
From
22/01/2019 12:56:57
 
 
To
22/01/2019 10:47:35
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01665620
Message ID:
01665627
Views:
66
>>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.
>
>Why I don't see why (you ask this), but obviously:
>
>
>update:
>Ah, I missed the point you like to have it as an ICASE
>
>ICASE(.T.,TestMatch(test1,test2,@lnVar1, @lnVar2))
>
>
>Rick, I do not understand what you are trying to do. It returns .T. and altere teh paras, one way is more or less like the next.
>Except
>Speed
>code clearence
>and:
>FUNCTIONS should not do this. A FUNCTION should return a value based on the parameters. No side effects, no parameter by reference.
>
>I've done odd things with functions (in VFP SQL, to get special effects), but at least a return value ....

In C and C++, for example, you could do the equivalent of this to do multiple assignments:
ICASE(test1, (lnVar1 = 1, lnVar2 = 2), test2, (lnVar1 = 10, lnVar2 = 20), (lnVar1 = -1, lnVar2 = -2))
I was just wondering if anyone knew of an ability to do something similar in VFP that didn't require functions and @references?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform