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.

Video Effects Codes

Code

Bold

Underlined

Blanked

Reversed

Flashing

Dimmed

Code

-128 This is video off. -128
-129           Dimmed -129
-130         Flashing   -130
-131         Flashing Dimmed -131
-132       Reversed     -132
-133       Reversed   Dimmed -133
-134       Reversed Flashing   -134
-135       Reversed Flashing Dimmed -135
-136     Blanked       -136
-137     Blanked     Dimmed -137
-138     Blanked   Flashing   -138
-139     Blanked   Flashing Dimmed -139
-140     Blanked Reversed     -140
-141     Blanked Reversed   Dimmed -141
-142     Blanked Reversed Flashing   -142
-143     Blanked Reversed Flashing Dimmed -143
-144   Underlined         -144
-145   Underlined       Dimmed -145
-146   Underlined     Flashing   -146
-147   Underlined     Flashing Dimmed -147
-148   Underlined   Reversed     -148
-149   Underlined   Reversed   Dimmed -149
-150   Underlined   Reversed Flashing   -150
-151   Underlined   Reversed Flashing Dimmed -151
-152   Underlined Blanked       -152
-153   Underlined Blanked     Dimmed -153
-154   Underlined Blanked   Flashing   -154
-155   Underlined Blanked   Flashing Dimmed -155
-156   Underlined Blanked Reversed     -156
-157   Underlined Blanked Reversed   Dimmed -157
-158   Underlined Blanked Reversed Flashing   -158
-159   Underlined Blanked Reversed Flashing Dimmed -159
-160 Bold           -160
-161 Bold         Dimmed -161
-162 Bold       Flashing   -162
-163 Bold       Flashing Dimmed -163
-164 Bold     Reversed     -164
-165 Bold     Reversed   Dimmed -165
-166 Bold     Reversed Flashing   -166
-167 Bold     Reversed Flashing Dimmed -167
-168 Bold   Blanked       -168
-169 Bold   Blanked     Dimmed -169
-170 Bold   Blanked   Flashing   -170
-171 Bold   Blanked   Flashing Dimmed -171
-172 Bold   Blanked Reversed     -172
-173 Bold   Blanked Reversed   Dimmed -173
-174 Bold   Blanked Reversed Flashing   -174
-175 Bold   Blanked Reversed Flashing Dimmed -175
-176 Bold Underlined         -176
-177 Bold Underlined       Dimmed -177
-178 Bold Underlined     Flashing   -178
-179 Bold Underlined     Flashing Dimmed -179
-180 Bold Underlined   Reversed     -180
-181 Bold Underlined   Reversed   Dimmed -181
-182 Bold Underlined   Reversed Flashing   -182
-183 Bold Underlined   Reversed Flashing Dimmed -183
-184 Bold Underlined Blanked       -184
-185 Bold Underlined Blanked     Dimmed -185
-186 Bold Underlined Blanked   Flashing   -186
-187 Bold Underlined Blanked   Flashing Dimmed -187
-189 Bold Underlined Blanked Reversed   Dimmed -189
-190 Bold Underlined Blanked Reversed Flashing   -190
-191 Bold Underlined Blanked Reversed Flashing Dimmed -191

Example 1

Commands

Terminal output

IH12

 

T C,"THE VALUE OF X IS:",

 

%1

THE VALUE OF X IS:12

Example 2

Commands

Terminal output

IH1000

 

T "DATE:",S3,%1:D:

DATE: 26 Feb 1990

Example 3

Commands

Terminal output

T (0,23),T,(O),"INVALID",

 

B,D,(O),S7,L

INVALID

This example displays the word INVALID  flashing on and off three times and sounds the bell.

Example 4

Commands Terminal output

T "ENTER PART NUMBER",+

 

IP:%3

ENTER PART NUMBER:_

Example 5

Commands

Terminal output

T *Q9

QQQQQQQQQ

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.