Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ICASE() alternative
Message
From
23/01/2019 01:48:45
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
22/01/2019 12:56:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01665620
Message ID:
01665660
Views:
62
>>>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?

Not that I know of. Also those C++ like return-the-value-of-var-and-increment stuff is not available. (a = i++)

BTW, since ICASE is a FUNCTION, I do not see the return value of the construct above?

Lutz
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform