T
Produces complex, formatted terminal output and displays buffer values.
Syntax
T element{,element}
-or-
T,element{,element}
-or-
T
Syntax Elements
element is text or format print, cursor control, or video effect commands, as listed below.
Elements
Elements can be one of the following:
"text" or 'text' Outputs the specified text. The text must be enclosed in double or single quotes.
@SYS{TEM}(arg)Outputs the value returned by the SYSTEM function for arg.
r{;input;} Prints the value obtained by direct or indirect reference to a buffer or select register specified by r. An optional English input conversion (input) can be applied to the value prior to printing.
r{:output:} Prints the value obtained by a direct or indirect reference to a buffer or select register specified by r. An optional English output conversion (output) can be applied to the value prior to printing.
(c,r) Sets the terminal cursor to the column number specified by c and the row number specified by r. The values c and r can be direct or indirect buffer references.
(c) Sets the terminal cursor to the column number specified by c of the current row.
(,r) Sets the terminal cursor to the row number specified by r of the current column.
*cnOutputs the character c the number of times specified by n. The value n can be a direct or indirect reference to a buffer or select register containing the value for the number of times to output character c.
(-n) Provides terminal independent cursor control or video effects.
+ Inhibits RETURN/LINEFEED output at the end of a T command.
B Sounds terminal bell.
C Clears the screen (outputs top-of-form).
D Causes a delay. Usually used with T and L elements to cause a blinking display.
IrConverts the integer r, where 0 = r = 255, into its equivalent ASCII character.
r can be a direct or indirect reference to a buffer or select register that contains the integer.
L Terminates a loop started with the T element. The elements between the T and the L are executed three times.
SnOutputs the number of spaces specified by n.
The value n can be a direct or indirect reference to a buffer or select register that contains the number of spaces.
T Marks the top of a loop. The loop is terminated by the L element. The elements between T and L are executed three times.
U Moves the cursor up one line.
XrConverts the hex value r, where 00 = r = FF, into its equivalent ASCII character. The value r can be a direct or indirect reference to a buffer or select register that contains the hex value.
"[K" Clears the rest of the line. ([ is the ESCAPE key.)*
"[J" Clears the rest of the screen. ([ is the ESCAPE key.)*
* The ESC+K and ESC+J sequences must be enclosed in quotes and only work on terminals that support this feature.
You can also use (-3) and (-4) to clear the line and screen. See Terminal Independent Cursor Control.
Operation
Used without any elements, the T command starts a new line (RETURN/LINEFEED).
Otherwise, the command name must be followed by either a single space or a comma, and one or more elements, separated by commas. It can be continued on subsequent lines by ending the line with a comma. Continuation lines do not start with a T.
Note
If the last element is a plus sign (+), RETURN/LINEFEED is not output. This is ideal when using a T command to prompt for input.
Terminal-independent Cursor Control
Terminal independent cursor control is available using the same table of negative numbers applicable to DataBasic in an element of form (-n). Parameter -n can be:
-1 Clear screen sequence including the number of pad characters specified in the FF delay field of the TERM settings.
-2 A cursor-home sequence.
-3 A clear-to-end-of-screen sequence.
-4 Clear-to-end-of-line sequence.
-5 to -8Reserved.
-9 A cursor-back sequence.
-10 A cursor-up sequence.
-11 Cursor on.
-12 Cursor off.
-13 Status line on.
-14 Status line off.
-15 Cursor forward.
-16 Cursor down.
-17 Slave port on.
-18 Slave port off.
-19 Screen dump to attached printer.
Video Effects
Negative numbers between -128 and -255 are used to generate video effects. the table below shows the video characteristics set by each number.
Example 1
Commands |
Terminal output |
---|---|
|
|
|
|
|
|
Example 2
Commands |
Terminal output |
---|---|
|
|
|
|
Example 3
Commands |
Terminal output |
---|---|
|
|
|
|
This example displays the word INVALID
flashing on and
off three times and sounds the bell.
Example 4
Commands | Terminal output |
---|---|
|
|
|
|
Example 5
Commands |
Terminal output |
---|---|
|
|
Example 6
T X1B,"K" or T I27,I75 or T (-4)
On most terminals, any one of these three commands erase from the current cursor position to the end of the line and return the cursor to its original position.
Example 7
T (-3)
This command erases from the current cursor position to the end of the screen and returns the cursor to its original position.