Returns or sets an expression that stores any extra data (string) needed for your program. Unlike other properties, the value of the Tag property isn't used by GFA-BASIC 32; you can use this property to identify objects.
object.Tag [= exp ]
object:Ocx object
exp:String expression
You can use this property to assign an identification string to an object without affecting any of its other property settings or causing side effects. The Tag property is useful when you need to check the identity of a control or MDI Form object that is passed as a variable to a procedure.
Ocx Command cmd = "This is the Caption Text", 10, 10, 140, 22 : cmd.Tag = "This is the Tag Text"
Ocx CheckBox chk = "Show Tag Text in Caption", 10, 40, 160, 14
Do : Sleep : Until Me Is Nothing
Sub chk_Click
Select chk.Value
Case 0 : cmd.Caption = "This is the Caption Text"
Case 1 : cmd.Caption = cmd.Tag
EndSelect
EndSub
As an alternative, the HelpContextID property can be used as a place to store additional data. This property is an Integer and therefore it's performance much better.
{Created by Sjouke Hamstra; Last updated: 24/10/2014 by James Gaite}