MetaData
(Engine-Level Function)
Depending on the context in which it is used, this command has two different purposes.
Description: | If used with a variable which is not a dictionary, this command attaches meta data to that variable, thereby creating a dictionary object. The primary purpose in this case is to provide a means of associating extended data with a variable. If used with a variable which is a dictionary, this command will return the value associated with the specified key. |
Returns: | Varies - see description |
Usage: | Script or steady state. |
Function Groups: | Dictionary, Variable |
Related to: | Dictionary |
Format: | MetaData( dictionary, key, [case sensitive] ); |
Parameters: |
Dictionary |
Required. A variable name that will become the dictionary. |
Key |
Required. A text value. Integers may be used, but will be cast to text. This will become the first key within the dictionary. |
Case |
An optional Boolean, controlling whether the dictionary will use case sensitive keys or non case sensitive. TRUE (default) defines a non-case sensitive key. FALSE defines case sensitive. |
Example 1: Adding meta data to a variable
X = 42; { X is an integer variable with the value 42 } MetaData(X, "A", 1 ) = 10;
X becomes a case sensitive dictionary having a root value that is the integer 42 and possessing one key, "A", that has the value 10.
Example 2: Retrieving the meta data from a dictionary
X = Dictionary(5); X["A"] = 42; Y = MetaData(X, "A");
Y will now hold the integer 42, being the value stored with the key "A" in the dictionary X.