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 06:01:31
 
 
À
01/04/2021 05:32:19
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01679404
Message ID:
01679421
Vues:
31
>>>UPDATE. In the debugger the value in the property PRE_FILTER is .F. So, basically, when using =cTest, VFP evaluates. But this is not what I wanted.
>>
>>Dmitry, are you defining the class in a Visual Class Library (*.vcx) or in a Program File (*.prg)?
>>
>>This is the effect you want, right?
>>
>>
>>PUBLIC cTest AS String
>>
>>m.cTest = "IN_SERVICE = 'Y'"
>>
>>LOCAL DLI AS DL
>>
>>m.DLI = CREATEOBJECT("DL")
>>
>>? m.DLI.PRE_FILTER     && prints IN_SERVICE = 'Y'
>>
>>DEFINE CLASS DL AS Custom
>>
>>	PRE_FILTER = m.cTest
>>
>>ENDDEFINE
>>
>
>Are you sure the changes of the value of cTest would be propagated to the property? If it's assigned like this, the assignment happens only when the object is instantiated. Even creating a new object still contains the value as it was for the first instantiated object.
>

Good point, Dragan, but what I want to know is if Dmitry is using a VCX or a PRG, since he questioned himself "the way I set the value to the property". If I got this right, he's not getting cTest at all, and I don't even know if the variable is going to change during the course of the execution if the program.
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform