table view

Prev Next

Function Names

table view

Library

Support Library

Description

This function displays a table on the console and provides a set of navigation features to browse the contents. A set of characters (incl. function and navigation keys) can be defined to leave the viewer when such a character has been pressed.

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)
F1 Quick on-screen help for the available navigation functions
F4 Sort (push F4 on same column again to sort in opposite direction), if allowed

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.

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.

If the prompt consists of two rows, separated with a new line character, then the first line will be displayed above the table (instead of a standard table header info) and the 2nd line will be used as the prompt.

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
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 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 Not applicable for this function. Will be ignored.

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

view
variable view