$dbgString
Get a string that represents the Struct or Struct collection, including annotations.
Struct->$dbgString
Return Values
Returns a string that can be used for debugging.
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 $dbgString when you need to verify the structure and annotations of a Struct.
$dbgString is intended for use
during development, to visually represent and format the contents of a struct
variable. It can be used to display the Struct as string, for example, in the message frame.
The returned string shows a nested structure that includes both the normal Struct and the $tags Structs:
-
The name of the Struct is printed on the first line between square brackets, with proper indentation.
-
A Struct leaf is followed by an equal sign (
=
) and its value. -
String values are in double quotes.
-
All other data types (numeric/float, date, raw, and so on) are displayed without quotes
-
A node with no members and no value is considered to hold an empty string
-
If annotations exist, the $tags Struct is displayed as the first Struct under a node; it precedes the member list.
Uniface Component Struct
For example, given the following component structure:
And the following data:
The Struct function $dbgstring returns a formatted string that represents the Struct:
[DATA_FRM] [$tags] [u_type] = "component" [NM_ENTITY.NM] [$tags] [u_type] = "entity" [OCC] [$tags] [u_type] = "occurrence" [FIELD1] = "Text can be bold or italic" [$tags] [u_type] = "field" [FIELD2] = "but not in all widgets." [$tags] [u_type] = "field"
String Returned for an XML Struct
For example, given the following XML code:
<div class="note">Text can be <b>bold</b> or <em>italic</em></div>
The Struct function $dbgstring returns a formatted string that represents the Struct:
[] [div] [$tags] [xmlClass] = element [class] = note [$tags] [xmlClass] = attribute [] = Text can be [b] = bold [$tags] [xmlClass] = element [] = or [em] = italic [$tags] [xmlClass] = element
- Top-level Struct.
- Struct node.
-
$tags
Struct containing annotations for the member. -
xmlClass
shows that the member represents an XML element. - Struct leaf, with its value being the only member.
-
xmlClass
shows that the member represents an XML attribute. - Scalar struct. For more information, see Struct Leaves.
Version | Change |
---|---|
9.5.01 | Introduced |