Struct Functions

Struct functions enable you to get information about a Struct (such as the number of members it has), get or set Struct annotations, or perform actions such as inserting and moving Struct members.

Syntactically, they are treated as Struct members and are accessed using the dereference operator (->):

Struct->StructFunction

For example:

vBook->$membercount

Unlike true members, Struct functions are not part of the Struct member list and they do not have an index.

Struct function names always begin with a dollar sign $. Unlike other functions, they do not use parentheses ().

Struct Functions
ProcScript Description
$collSize Get the number of Structs in the collection
$dbgString Get a string that represents the Struct or Struct collection.
$dbgStringPlain Get a string that represents the Struct or Struct collection, but without annotations.
$index Get or set the index of the Struct in a Struct collection.
$isLeaf Check whether a Struct is a Struct leaf (the logical end point in a Struct tree)
$isScalar Check whether a Struct is a scalar Struct.
$istags Check whether the Struct is a $tags Struct for another Struct
$memberCount Get the number of members in a Struct.
$name Get the name of a Struct
$parent Get or set the parent of the Struct.
$scalar Get or set the scalar members of a Struct
$tags Get or set annotations for a Struct.

Setting Struct Functions

Although most Struct functions only return information, the $index, $parent, and $tag functions can be used to change data. You can use:

  • $index to insert a member into a Struct at the specified index.
  • $parent to move a Struct member from one Struct to another.
  • $tags to set the value of annotations, or define your own annotations fro use in conversion routines.

For more information, see Struct Annotations.

Related Topics