Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set a variable to a property?
Message
De
01/04/2021 11:44:20
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01679404
Message ID:
01679435
Vues:
41
>Antonio,
>Thank you for your message.
>The class is in the Visual Class Library (*.VCX). Let me provide more details:
>I have a form class (equipment) in a library equip.vcx
>There is a BIZ class dropped on this form (BIZ class is EQ_BIZ).
>The BIZ class EQ_BIZ has a property PRE_FILTER.
>I am trying to set the value of PRE_FILTER to some public variable cTest. The public variable cTest is declared in the LOAD of the EQUIPMENT form; therefore, it is in the scope when the EQ_BIZ is initialized.
>I am trying to figure out how to assign the value of the variable cTest to the property EQ_BIZ.PRE_FILTER.
>I tried:
>(at design time): setting the value of EQ_BIZ.PRE_FILTER = cTest This does not work.
>I also tried to use a macro, Example: EQ_BIZ.PRE_FILTER = &cTest. This does not work.
>
>Do you see what I am trying to do?

Dimitry, I'm not saying that this will work as you intend, but, to assign the content of the variable cTest to a user defined property in the the property window, you should input = m.cTest (verbatim, starting with the equal/assignment symbol). Otherwise, VFP will store the value "cTest" or "&cTest". I believe Dragan (sorry if I got this wrong) already mentioned this, in a message above.

I think that it doesn't matter if the variable is in scope at the time you insert the expression in the property window, but things can get ugly if the expression can not be resolved at instantiation time.
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform