Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object.Tag purpose
Message
From
26/09/2005 09:52:22
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01051560
Message ID:
01053020
Views:
15
>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform