Tag Property

Returns or sets a string that stores any extra data needed by the application.

Syntax

Object.Tag (lId) [ = vTagData ]

The Tag property syntax has the following parts:

 

Name

Type

Description

Object

Object

An object

lId

[Val] Long

Optional tag ID number. Default is 0.

vTagData

Variant

A variant containing any extra data needed by the application.

Comments

The Tag property allows storing extra application user defined data used by the application. The initial value for the Tag(0) for certain classes can be set during design time from the object Properties windows (for example, from the Test Properties window).  

When the class that holds the tag is out of scope the tag is reset and the values stored in the tag are gone. For example when a form is destroyed the forms objects (controls, menus, etc.) tags are emptied.  

ATEasy 2023/v12 or newer - Multiple data tags can be stored and retrieved in the Tag property. The lId number parameter is used to identify them.  AProgram, ATask and ATest maintain their tag values between run for the same UUT. lId values with high-bit set to 1 (> 0x80000000) are used by ATEasy Test Executive.  

Example

The following statement changes the ACheckBox Tag:

chk1.Tag="Master checkbox"

 

The following example use the Test.Tag to store array test limits, which are used latest in OnEndTest to evaluate the test status:

! Sets the test custom test limits in the test code

aadLimits={{0.85, 1.15}, {1.85, 2.15}, {2.85, 3.15}, {3.85, 4.15}}

Test.Tag(aTagArrayLimits)=aadLimits

...

! check if Test Results, typically in OnEndTest() event code

for i=0 to 3

if TestResult<Test.Tag(aTagArrayLimits)[i, 0] or TestResult>Test.Tag(aTagArrayLimits)[i, 1]

TestStatus=FAIL

exitloop

endif

next

Applies to

All controls, AForm, AApp, ACriticalSection, ADriver, AEvent, AMenu, AMutex, AProgram, ASemaphore, ATabPage, ASystem, ATask, ATest, AUser, AAppFolder, AAppShortcut

See Also

Caption, Description, Name, Text