Parameter Metadata

You can assign metadata to module parameters when declaring them. This technique is used to ensure that extra information about the parameter is assigned when the module opens and before any of the state code runs.

Parameter metadata is declared using the metadata assignment operators:

<:  :>

For example, given the module MyModule, with parameter A, a metadata value could be assigned as follows:

<
MyModule
(
  A  <: 5 :>;
)

The function of the assignment operators is similar to that of the SetVarMetaData() function. The values can be read using GetVarMetaData().

The most common use of parameter metadata is found in tag modules. The SQL data type of each parameter is assigned in the parameter declaration section:

(
  Name        <:TagField("SQL_VARCHAR(255)", "Name",        0 ):> };
  Area        <:TagField("SQL_VARCHAR(255)", "Area",        1 ):> };
  Description <:TagField("SQL_VARCHAR(255)", "Description", 2 ):> };
)

The SQL database conversion data for each parameter is recorded by instantiating TagField structures and assigning them in the parameter declaration section.