$index

Get or set the index (position) of a node in a Struct collection.

Struct->$index

Struct must refer to exactly one Struct.

Return Values

Return Values

Return Value

Meaning

>0

Index of the single Struct referred to by Struct

0

Struct refers to multiple Structs, so it returns an invalid index.

Values of $procerror Commonly Returned Following $index

Value

Error Constant

Meaning

-84

UACTERR_NO_OBJECT

StructVariable is not initialized, or does not refer to exactly one Struct

-1152

STRUCTERR_INDEX_NOT_ASSIGNABLE

StructVariable has no parent (it is a top-level node), or StructVariable refers to the $tags Struct of another Struct

-1154

STRUCTERR_INDEX_OUT_OF_RANGE

Tried to assign a single Struct to a number greater than the number of members of the parent, or smaller than one and not equal to -1

-1156

USTRUCTERR_NOT_A_SINGLE_STRUCT

Tried to assign a struct to multiple parents.

Description

You can use the $index function to move Struct members to a specific position in its parent Struct or to a specified position in another Struct.

Moving a Struct

Move a Struct to the last position in its parent member list:

vStructA->$index = -1
History

Version

Change

9.5.01

Introduced

Related Topics