Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF in a Control Source
Message
De
28/08/2001 11:57:26
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
28/08/2001 02:37:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00549697
Message ID:
00549878
Vues:
19
>>Can I do an IIF statement in a textbox.controlsource? Further, can that IIF statement call a UDF which passes a value back to the control source for display on the screen?
>>
>>Thanks, Randy
>
>From the property sheet, no (Data Source for this object must be a variable reference). From the Init method I was able to do:
>
>this.ControlSource = IIF(condition,'FirstVar','SecondVar')
>
>and it was accepted and updated the proper variable.

Note that we're talking about two things here: one is an iif() used to determine what would be the controlsource (that's what you suggest), and the other is something like

.controlsource='(iif(condition,alias1.field1,alias2.field2))'

which would be recalculated on each refresh. Note the parentheses around the whole expression, which tell the PEM parser (or whatever the engine may be called) to re-evaluate the expression, instead of evaluating it only once, or binding it permanently.

Though, I think a field like the one above may be read-only or at least unbound. I know this is a regular way to include a calculated field into a grid - use something like this in column's controlsource, but I'm not really too sure whether it is bound or not.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform