Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ICASE() alternative
Message
De
22/01/2019 12:56:57
 
 
À
22/01/2019 10:47:35
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01665620
Message ID:
01665627
Vues:
67
>>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?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform