$dbgStringPlain

Get a string that represents the Struct or Struct collection, without the annotations ($tags).

Struct->$dbgStringPlain

Return Values

Returns a string that can be used for debugging.

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

$dbgStringPlain 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. This function is also used in the Debugger.

Note:  It is not intended to be a serialized form of the Struct. It is not possible to recreate a Struct from a string that was created this way,

The returned string shows only the nested structure of the Struct, without the $tags Structs. This makes it easier to use when annotations are not relevant.

In the returned string:

  • 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

Example: Uniface Component Struct

For example, given the following component structure:

Component Structure

Component Structure with entity and two fields

And the following data:

Runtime Data

runtime form with data

The Struct function $dbgStringPlain returns a formatted string that represents the Struct:

[DATA_FRM]  Callout 1
  [NM_ENTITY.NM]  Callout 2
      [OCC]  Callout 3
        [FIELD1] = "Text can be bold or italic"  Callout 4
        [FIELD2] = "but not in all widgets."
  1. Named top-level Struct with name of component
  2. Named Struct node for entity
  3. Struct node for occurrence. The name is fixed to OCC
  4. Struct leaf for field
History

Version

Change

9.5.01 E101

Introduced

Related Topics