Meta Data

Meta data provides a means of attaching extended information to variables.  The concept is inspired by XML and is based on dictionaries.

To illustrate, in XML, one might see the following structure which attaches two attributes (name1 and name 2 containing values "x" and "y" respectively) to the object, 2.

<tag name1="x" name2 = "y">

dictionary_with_two_defs.gif2

</tag>

In VTS, this can be written as:

            2

Name1 = "x"

Name2 = "y"

 

The underlying data structure would be implemented in a dictionary as shown to the right:

The primary function for linking the meta data to a variable is the function, MetaData().

As described in Dictionaries, this command, when applied to any existing variable, will attach extra information to that variable.

To repeat an example:

Y  =  10;

MetaData( Y,  "Area"  )  =  20;

In this example, Y starts as an integer and then becomes a non-case sensitive dictionary having a root value of 10 (the original value) and possessing one key named "Area" which initially has a value of 20.  Most functions and operands dealing with Y will continue to take its root value of 10, ignoring the fact that Y is now a dictionary.

Related Functions: 

MetaDataListKeysHasMetaData