$isScalar
Checks whether a Struct node is a scalar Struct.
Struct->$isScalar
Return Values
|
Return Value |
Meaning |
|---|---|
|
|
Struct is scalar member |
|
|
Struct is not a scalar member |
|
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
|
Version |
Change |
|---|---|
|
9.5.01 |
Introduced |