$isScalar

Checks whether a Struct node is a scalar Struct.

Struct->$isScalar

Return Values

Return Values

Return Value

Meaning

0

Struct is scalar member

1

Struct is not a scalar member

Values of $procerror Commonly Returned Following Struct Functions

Value

Error Constant

Meaning

-84 UACTERR_NO_OBJECT Struct refers to zero Structs
-1151 USTRUCTERR_NO_COMMON_CHARACTERISTICS Collection of Structs that do not share a common parent or the specified characteristic
-1157 USTRUCTERR_ILLEGAL_MEMBER_TYPE Not a valid Struct member type

Description

Use $isScalar to check whether the Struct is a scalar Struct. A scalar Struct is used only to contain the scalar value. It cannot have sub-nodes, and it is not possible to use access operators (such as ->) on a scalar Struct.

It fulfills the following conditions:

  • $membercount returns 0 members

  • $isLeaf returns 1 (true)

  • $isScalar returns 1 (true)

For more information, see Struct Leaves.

$isScalar

The following code checks whether a Struct member is a scalar Struct before assigning it to a field:

if (vStruct->*{1}->$isScalar)
  FLD1 = vStruct->{1}
endif
History

Version

Change

9.5.01

Introduced