Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object.Tag purpose
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01051560
Message ID:
01053020
Vues:
16
>>>Hello,
>>>
>>>What is the use of Object.Tag?
>>
>>You can keep any data there (that data must be Char) From Help for TAG property:
>>Stores any extra data needed for your program. Available at design time and run time.
>
>Yes, I understand that...
>
>But, I just found out that mostly every object has such property, but I would like to ask UT users where they used this property. Is it usefull? Maybe there is some function getObjectByTag?

I used the TAG for checking whether data was changed in the VALID() EVENT:

In the When() event put this code:
THIS.TAG = TRANSFORM(THIS.VALUE)
And in the Valid() event I can check whether anything was changed:
IF NOT THIS.TAG == TRANSFORM(THIS.VALUE)
    *-- Data was changed.
ELSE
    *-- Data was not changed.
ENDIF
The disadvantage of using the TAG property this way is, that because it is a multi purpose property you may not know whether the property was already used somewhere else in the code and this may break your code.

Normally it is much better to use one property for only one specific purpose.
Christian Isberner
Software Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform