$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 Value |
Meaning |
---|---|
> |
Index of the single Struct referred to by Struct |
|
Struct refers to multiple Structs, so it returns an invalid index. |
Value |
Error Constant |
Meaning |
---|---|---|
|
|
StructVariable is not initialized, or does not refer to exactly one Struct |
|
|
StructVariable has no parent (it is a top-level node), or StructVariable refers to the $tags Struct of another Struct |
|
|
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
|
|
|
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
Version |
Change |
---|---|
9.5.01 |
Introduced |