variable view

Prev Next

Function Names

variable view

Library

Support Library

Description

This function displays the contents of a specified variable, including all its array and structure members and sub-members. At the beginning, 2 levels are displayed: The base variable and its direct array or structure members. On the every row where a plus sign (+) is visible, push the plus key on the keyboard to open up further details. Alternative, push the greater-than sign (>) to open all details. A set of characters (incl. function and navigation keys) can be defined to leave the viewer when such a character has been pressed.

Following contents will be displayed:

Variable Name The variable name on the 1st row is the top-level variable name as specified in the 1st function parammeter. In the rows below, the member variable names or index numbers are displayed.
Contents Displays the contents of the variables
Type Displays the type (If the option 'json' isused, then JSON naming convention is used)
Form Distinguishes between simple variable, array, structure and zero members (array with 0 numbers). (If the 'json' option applies, 'object' will be used in place of the structure.)
Level Variable hierarchy level. Base variable: 0. First level members: 1, sub-members: 2, and so forth.
Weight Number of further member variables underneath, including this one.



While viewing the table, following navigation keys are available:

Key Function
Move up
Move down
Move left
Move right
Pg up 1 screen page up
Pg dn 1 screen page down
Home Move to 1st column
End Move to last column
Ctrl-Home Move to 1st row
Ctrl-End Move to last row
Ctrl- ↑ Reduce number of screen lines to display contents
Ctrl- ↓ Increase number of screen lines to display contents
Ctrl- ← Reduce column width
Ctrl- → Increase column width
Ctrl-C Copy cell contents into clipboard (Pushing Ctrl-C twice in a row stops program execution)
+ When the cursor lies on a row with a '+' marker, then the next level of member variables become visible.
> When the cursor lies on a row with a '+' marker, then all further levels of member variables become visible
- When the cursor lies on a row with a '-' marker, then the details below will be hidden again.
F1 Quick on-screen help for the available navigation functions. Will vanish when continuing navigating.
F3 Provides more details about the selected variable, see below. Will vanish when continuing navigating.

Contents visualized with highlighted (typically yellow) text color are incomplete. Widen the columns and/or increase the number of rows to see the full contents if needed. One the entire contents are visible, then the highlighting vanishes.

Variable details explained (when pushing F3):

Depth Total number of levels of the variable. For simple variables, it is 1. For arrays and structures with members, but without sub-members, it is 2.
Weight Total number of member variables, including the base variable at the referenced location.
Tree Profile The total weight broken down into different levels. The 1st level is always 1 because it represents the base variable. The 2nd level refers to its members, and so forth.
Leaf Count The total number of leaf variables containing valid data. Intermediate variables with members are not counted, even if they carry valid data.
Leaves Profile The total number of leaf variables is broken down into different levels, similar to Tree Profile.

Call as: procedure or function

Restrictions

Under normal conditions, the 'Support Library' is loaded automatically, so no 'include(...)' call is needed.
Not suitable for batch processing

Parameter count

3-6

Parameters

No.TypeDescription
1.
input
string Name of existing table

The contents of this table will be displayed

2.
input
string Prompt

The prompt text will be displayed at the bottom of the table. UNICODE PUA2 characters (like &yellow; for yellow texdt) are allowed here to add visual effects.

3.
input
string Return characters

This string contains all return characters which will stop viewing when one of these characters or keyboard codes have been pressed. Example: 'ABC&f3;&shift-f4;&escape;' + new line will stop browsing when A, B, C, F3, Shift-F4, the Enter key or the Escape key has been pressed.
Note: The entities &nl; and &escape; are unofficial entitites not supported by browsers, but accepted by B4P.

Opt. 4.
input
parameter set Options

The parameters set may contain the following options.

full row cursor The enire row will be marked
hide row numbers The row numbers on the left-hand-side will be hidden (for simplified output)
select no headers (Already and always active when viewing variables) - The cursor cannot be moved into the header row, i.e. header row and its contents cannot be selected
ignore case The entered character will be compared with the return characters, but ignoring upper/lower case. Letters returned are in upper case.
no deco No color features like background zebra pattern
no input The table will be displayed, but no prompt will show up and no input will be requested. Suitable for passive display.
wrap Contents containing line breaks will be shown over multiple rows
alt screen The table will be displayed on an alternative screen. The previous screen contents with its history will resume after done viewing.
json JSON naming convention will be used.

Default value: {} (empty set) - No options specified
Opt. 5.
output
numeral Row

The table row number where the cursor was located when leaving the table will be returned.

Opt. 6.
output
numeral Column

The table column number where the cursor was located when leaving the table will be returned. The 1st column is column 0. In case the option 'full row cursor' is chosen, then the column number shown at the left hand side of the screen will be returned.

Return value

TypeDescription
string Entered command

The chosen character, as specified in the 3rd function parameter, will be returned.

See also

inspect
see
table view