IWS supports indirect access to tags in the database. For example, consider a tag X of the String type. This tag can hold the name of any other tag in the database (that is, it can provide a pointer to any other type of tag, including a class type). The syntax for an indirect tag is straightforward: @IndirectTagName. For example, assume that a tag named X holds a "TEMP" string. Reading and/or writing to @X provides access to the value of the TEMP variable.
To refer to a class-type tag, you can declare a string-type tag that points to a class tag. For example:
Class | TANK with members Level |
Tag | TK of the class TANK |
Tag | XCLASS of the String type |
To access the TK.Level value, you must store the " TK.Level" value within the XCLASS tag and use the syntax, @XCLASS. You can also refer to a member of a class-type tag directly; identifying a class-type that points to a class member.
For example:
Class | TANK with members Level |
Tag | TK of the class TANK |
Tag | XCLASS of the class TANK |
To access the TK.Level value, you must store the "TK" value within the XCLASS tag and use the syntax, @XCLASS.Level.
When creating tags for indirect use, place an X in the tag column rather than creating them as strings. For the type, write the type of tag for which you are creating a reference. Follow the XCLASS example: @Z Integer, @X Class:TANK.
Indirect tags "point" to other database tags (including class-type tags). Using indirect tags can save development time because they keep you from having to create duplicate tags (and the logic built into them).
You create an indirect tag from any string-type tag simply by typing the @ symbol in front of the tag name @TagName.