@() Function

The @() function provides a standard means of performing control functions on a wide array of terminals.

Syntax

@(num.exp{,num.exp})

Description

Special cursor-control characters for the current terminal type (as defined by the term settings in effect at the time) can be generated by using negative values with the @() function. The values generated by the @() function are specified in the TCL define-terminal command.

@(column)

Generates terminal output codes to position the cursor to a specified column on the current row. The value of the expression column must be within the column width limits for the terminal device. The column farthest to the left is column 0. The column farthest to the right is determined by the TCL term command terminal width setting.

@(column,row)

Generates terminal output codes to position the cursor to a specified location. The values of the expressions used in the @() function must be within the row and column limits of the terminal screen. The top row is row 0. The bottom row is determined by the TCL term command terminal depth setting. Location (0,0), the top-left corner, is known as the home position. Using this function on output to a printer can have unpredictable results. This function does not change the results from the system(4), system(5), and system(6) functions.

 

NOTE

  • Many of the functions below do not behave properly unless the term type setting of the TCL term command corresponds to the emulation type currently defined in the terminal.

  • If additional, customized @() functions are added, it is recommended that they start at @(-1001) or so. This ensures that they do not conflict with existing or future functions.

  • Use of any of the @() functions invalidates the system(4), system(5), and system(6) function results.

 

@() Function

Description

@(-1)

Clears screen and positions the cursor to column 0, row 0 (the home position).

@(-2)

Positions the cursor to column 0, row 0 (the home position).

@(-3)

Clears the screen from the current cursor position to the end-of-screen.

@(-4)

Clears the screen from the current cursor position to the end of the current line.

@(-5)

Begins blink mode. All characters entered after this command blink on and off. This mode remains in effect until it is terminated by the @(-6) function.

@(-6)

Terminates blink mode.

@(-7)

Begins protected-field mode, which protects characters from being overwritten by data entry. Usually, characters are displayed at a lower intensity to indicate protected-field mode. This mode remains in effect until it is terminated by the @(-8) function.

@(-8)

Terminates protected-field mode.

@(-9)

Moves the cursor one position to the left (nondestructively). If performing this function from the left margin, the cursor can either remain at the margin, or wrap to the last position on the previous line, depending upon the brand of terminal.

@(-10)

Moves the cursor one position upwards (nondestructively). If performing this function from the top margin, the cursor can either remain at the margin, or wrap to the bottom row, depending upon the brand of terminal.

@(-11)

Enables protect mode, which allows the terminal to accept protected-field mode commands @(-7) and @(-8).

@(-12)

Disables protect mode. Disables the terminal’s ability to accept protected-field mode commands @(-7) and @(-8).

@(-13)

Starts reverse video mode. Changes the foreground (character) color to the background color, and conversely. This mode remains in effect until it is terminated by the @(-14) function. The output processor uses this mode as boldface-on mode.

@(-14)

Terminates reverse video mode.

@(-15)

Begins underline mode. All characters entered after this command are underlined. This mode is terminated by the @(-16) function.

@(-16)

Terminates underline mode.

@(-17)

Begins slave-printer (transparent) mode, which enables the terminals auxiliary serial (slave printer) port. This mode remains in effect until it is terminated by the @(-18) function.

@(-18)

Terminates slave-printer mode.

@(-19)

Moves the cursor one position to the right (nondestructively). If performing this function from the right margin, the cursor can either remain on the margin, or wrap to the first column on the following line, depending upon the brand of terminal.

@(-20)

Moves the cursor one position downwards (nondestructively). If performing this function from the bottom margin, the cursor can either remain at the margin, or wrap to the top row, depending upon the brand of terminal.

@(-21)

Graphics character set on. Enables the terminals ability to accept and display graphics characters (characters 128-255). This mode remains in effect until it is terminated by a @(-22) function.

@(-22)

Graphics character set off. Disables the terminals ability to accept and display graphics characters.

@(-23)

Keyboard lock. Disables the terminals ability to accept any input from the keyboard. This mode remains in effect until it is terminated by the @(-24) function.

@(-24)

Keyboard unlock. Enables the terminal to accept input from the keyboard.

@(-25)

Control character enable. Enables the terminals ability to accept and transmit control characters (characters 00-31). D3 does not redisplay control characters.

@(-26)

Control character disable. Disables the terminals ability to accept and transmit control characters.

@(-27)

Write status line. Positions the cursor on the status line, and writes the text that follows on that line. The status line is the bottom line of the terminal display and is not considered part of the active display area. That is, it is not cleared when a TCL clear-screen command is issued. The line is not used for data input. It is usually used as a legend for the top row of function keys, or as a status display.

@(-28)

Erase status line. Positions the cursor on the status line, and erases any data on the line.

@(-29)

Initialize terminal mode. Resets (initializes) the terminal to its original power-on settings.

@(-30)

Download function keys. Accepts the character string that follows and applies it to a function-key translate table. Now, when a function key is pressed, a (previously-defined) string of keystrokes is transmitted.

@(-31)

Nonembedded stand-out on. Enables the display of terminal display attribute codes (normally hidden).

@(-32)

Nonembedded stand-out off. Disables the display of terminal display attribute codes (normally hidden).

@(-33) to @(-40)

Set color terminals background colors.

@(-33)

Set Background Color = WHITE.

@(-34)

Set Background Color = BROWN.

@(-35)

Set Background Color = MAGENTA.

@(-36)

Set Background Color = RED.

@(-37)

Set Background Color = CYAN.

@(-38)

Set Background Color = GREEN.

@(-39)

Set Background Color = BLUE.

@(-40)

Set Background Color = BLACK.

@(-41) to @(-48)

Set terminals foreground (character) colors to a full-intensity color.

@(-41)

Set Foreground Color = WHITE.

@(-42)

Set Foreground Color = BROWN.

@(-43)

Set Foreground Color = MAGENTA.

@(-44)

Set Foreground Color = RED.

@(-45)

Set Foreground Color = CYAN.

@(-46)

Set Foreground Color = GREEN.

@(-47)

Set Foreground Color = BLUE.

@(-48)

Set Foreground Color = BLACK.

@(-49) to @(-56)

Reserved.

@(-57) to @(-64)

Set terminals foreground (character) colors to a low-intensity color.

@(-57)

Set Foreground Color = WHITE.

@(-58)

Set Foreground Color = BROWN.

@(-59)

Set Foreground Color = MAGENTA.

@(-60)

Set Foreground Color = RED.

@(-61)

Set Foreground Color = CYAN.

@(-62)

Set Foreground Color = GREEN.

@(-63)

Set Foreground Color = BLUE.

@(-64)

Set Foreground Color = BLACK.

@(-65) to @(-86)

Reserved.

@(-87)

Set to full-intensity white background.

@(-88)

Reserved.

@(-89)

Sets a monochrome terminal to black & white in 80 columns by 25 rows mode.

@(-90) to @(-92)

Reserved.

@(-93)

Sets a color terminal to Color 80 columns by 25 rows mode.

@(-94)

Sets a color terminal to black & white in 80 columns by 25 rows mode.

@(-95) to @(-98)

Reserved.

@(-99)

Embedded visual attributes. Some terminals, when they change visual display modes such as blink, underline, and protected-field, take up a position on the visual display to activate the mode change. Such a terminal is said to have the visual attribute embedded in the display, rather than having hidden visual attributes. This is not a terminal function, but a way to notify the program that the terminal does or does not use a space in visual attributes, allowing it to keep track of the current cursor position.

0 = Visual attributes are hidden.

1 = Visual attributes are embedded.

@(-100)

Sets the foreground (character) brightness to half-intensity. All characters entered after this command are displayed at half-intensity. This mode remains in effect until it is changed by the @(-101) function. The function @(-7) usually has the same visual effect, depending on the terminal. The Update Processor uses this function to display attribute values.

@(-101)

Sets the foreground (character) brightness to full-intensity. All characters entered after this command are displayed at full-intensity. This mode remains in effect until it is changed by the @(-100) function. The function @(-8) usually has the same visual effect. The Update Processor uses this function to display attribute names.

@(-102)

Enables italics mode, which displays all characters entered after this command in italics. This mode remains in effect until it is terminated by the @(-103) function.

@(-103)

Terminates italics mode.

@(-104)

Shifts the line printing by a half-line downwards (for printing subscripts). All characters entered after this command are written as subscripts until they are terminated by the @(-105) function.

@(-105)

Shifts the line printing by a half-line upwards (for printing superscripts). All characters entered after this command are written as a superscript until it is terminated by the @(-104) function.

@(-106)

Inserts a line. Used by the Update Processor for backwards scrolling.

@(-107)

Deletes a line.

@(-108) to @(-109)

Reserved.

@(-110)

Resets the printer to its original power-on settings.

@(-111) to @(-112)

Reserved.

@(-113)

Sets vertical motion index. Sets the height of a single line by specifying how many units to move down before printing the next line. The units differ between devices, but they are usually in 48ths, 72nds, or 300ths of an inch.

@(-114)

Sets the height of a single line by specifying how many lines are printed in an inch. This is typically 6 or 8 lines per inch. Setting the Lines Per Inch has no effect on the actual height of the character.

@(-115)

Sets the character width to enlarged. Assuming the standard character set is 10 chars per inch, the enlarged characters are 5 chars per inch.

@(-116)

Sets the character width to condensed. Assuming the standard character set is 10 chars per inch, the condensed character set is 16.7 chars per inch.

@(-117)

Sets the character width to proportional. The proportional character set’s width varies depending on the width of each individual character.

@(-118)

Enables the printer’s ability to skip over the page perforation on continuous forms. This can also be referred to as a Top or Bottom Page Margin. This mode remains in effect until it is terminated by the @(-119) function.

@(-119)

Terminates perf skip mode.

@(-120) to @(-124)

Reserved.

@(-125)

Sets horizontal motion index. Sets the width of a single character by specifying the amount of space (in units) to move the print head to the right for each character. Usually, the units are in 48ths, 72nds, 120ths, or 300ths of an inch.

@(-126)

Specifies which font is to be the default font. This setting is stored in the Sample.Windows.Printer item in the dm,devices, file. This function is also issued by AQL at the beginning of each printed report. See Default Font Management for more information.

@(-127) to @(-145)

Reserved.

@(-146) to @(-268)

Font Parameter from download using TCL command: setup-printer

@(-269)

For UNIX: Inter-job sequence for shared printers on UNIX systems. Sends a string of trailing characters at the end of a print job to indicate to the UNIX spooler services that this print job has terminated (closed). The character sequence cannot with two or more of the same characters.

For Windows: Not supported.

@(-270)

Font Parameter - Orientation - Portrait.

@(-271)

Font Parameter - Orientation - Landscape (sideways).

@(-272) to @(-300)

Reserved.

@() function codes 301 - 399 below support calling Windows Printer API methods. Two types of Windows Printer @() function codes are provided:

  • @() function codes 301 - 339 perform setup tasks in preparation for a print job.

  • @() function codes 340 - 399 perform the actual printing.

WARNING—Although multiple printing @() function codes can be concatenated, do not concatenate a setup @() function code with another setup @() function code or a printing @() function code. Setup @() function codes should always be isolated in a single statement.

NOTE—See the Windows GDI topic in Microsoft MSDN Library for more information on the Windows Printer methods.

See Windows Printer Interface for more information.

@(-301)

For UNIX: Not supported. Load object's x-coordinate position.

@(-302)

For UNIX: Not supported. Load object's y-coordinate position.

@(-303)

For UNIX: Not supported. Load object's selected point number.

@(-304)

For UNIX: Not supported. Load object's selected rectangle number.

@(-305)

For UNIX: Not supported. Load object's brush on draw rectangle.

@(-310)

For UNIX: Not supported. Load font's height of character.

@(-311)

For UNIX: Not supported. Load font's width of character.

@(-312)

For UNIX: Not supported. Load font's escapement angle.

@(-313)

For UNIX: Not supported. Load font's orientation angle.

@(-314)

For UNIX: Not supported. Load font's weight of font.

@(-315)

For UNIX: Not supported. Load font's italic flag.

@(-316)

For UNIX: Not supported. Load font's underline flag.

@(-317)

For UNIX: Not supported. Load font's strike out flag.

@(-318)

For UNIX: Not supported. Load font's character set.

@(-319)

For UNIX: Not supported. Load font's output precision.

@(-320)

For UNIX: Not supported. Load font's pitch and family.

@(-321)

For UNIX: Not supported. Load font's index of font name string.

@(-322)

For UNIX: Not supported. Load image’s path to bitmap file string.

@(-324)

For UNIX: Not supported. Load brush's style.

@(-325)

For UNIX: Not supported. Load brush's color.

@(-326)

For UNIX: Not supported. Load brush's hatch style.

@(-327)

For UNIX: Not supported. Load pen's style.

@(-328)

For UNIX: Not supported. Load pen's width.

@(-329)

For UNIX: Not supported. Load pen's color.

@(-330)

For UNIX: Not supported. Load point's x-coordinate.

@(-331)

For UNIX: Not supported. Load point's y-coordinate.

@(-332)

For UNIX: Not supported. Load rectangle's left x-coordinate.

@(-333)

For UNIX: Not supported. Load rectangle's top y-coordinate.

@(-334)

For UNIX: Not supported. Load rectangle's right x-coordinate.

@(-335)

For UNIX: Not supported. Load rectangle's bottom y-coordinate.

@(-336)

For UNIX: Not supported. Load image's raster opcode.

@(-337)

For UNIX: Not supported. Load image's stretch opcode.

@(-340)

For UNIX: Not supported. Create font.

@(-341)

For UNIX: Not supported. Create brush.

@(-342)

For UNIX: Not supported. Create hatch brush.

@(-343)

For UNIX: Not supported. Create solid brush.

@(-344)

For UNIX: Not supported. Create pen.

@(-345)

For UNIX: Not supported. Defines the default font. See Default Font Management for more information.

@(-346)

For UNIX: Not supported. Selects the default font. See Default Font Management for more information.

@(-347)

For UNIX: Not supported. Select font.

@(-348)

For UNIX: Not supported. Select brush.

@(-349)

For UNIX: Not supported. Select pen.

@(-350)

For UNIX: Not supported. Set x-coordinate position.

@(-351)

For UNIX: Not supported. Set y-coordinate position.

@(-352)

For UNIX: Not supported. Set text color.

@(-353)

For UNIX: Not supported. Set background color.

@(-354)

For UNIX: Not supported. Set background mode.

@(-355)

For UNIX: Not supported. Set text align.

@(-356)

For UNIX: Not supported. Set text extra spacing.

@(-357)

For UNIX: Not supported. Set the page orientation.

For portrait orientation: @(-357,1)

For landscape orientation: @(-357,2)

Since the orientation affects the entire printed page, this function must be included at the beginning of your document.

@(-358, x)

For UNIX: Not supported. Sets the number of lines on a print page where x is the number of lines.

@(-360)

For UNIX: Not supported. Draw rectangle.

@(-361)

For UNIX: Not supported. Draw rectangle with brush.

@(-362)

For UNIX: Not supported. Fill rectangle with brush.

@(-363)

For UNIX: Not supported. Draw line.

@(-364)

For UNIX: Not supported. Draw ellipse.

@(-365)

For UNIX: Not supported. Draw arc.

@(-366)

For UNIX: Not supported. Draw polygon.

@(-367)

For UNIX: Not supported. Draw bitmap - start.

@(-368)

For UNIX: Not supported. Draw bitmap with path - start.

@(-369)

For UNIX: Not supported. Draw bitmap - end.

Example(s)

The program below tests most of the commonly used @() functions:

print @(-1)

print @(-2)

print @(1,2):’clear from cursor position to end of the screen’

print str(’*’,250)

print @(12,2):

print @(-3)

print @(1,2):’clear from cursor position to end of the line’

print str(’*’,250)

print @(12,2):

print @(-4)

print @(1,6):

print @(-5):’blink on’:@(-6):’blink off’

print @(-13):’reverse video on’:@(-14):’ reverse video off’

print @(-15):’underline on’:@(-16):’ underline off’

print @(-100):’half intensity’:@(-101):’ full intensity’

print ’backspace 10 times’:

for i=1 to 10

print @(-9):

sleep(1)

next i

print

print ’forward 10 times’:

for i=1 to 10

print @(-19):

next i

print

print ’move cursor down 5 lines’:

for i=1 to 5

print @(-20):i:@(-9):

sleep(1)

next i

print

print ’move cursor up 5 lines’:

for i=1 to 5

print @(-10):i:@(-9):

next i

print @(2,22):"we’re done!"

The example below uses two @() functions. The first, @(-1), clears the screen and positions the cursor to the home position. The second, @(20,0), positions the cursor at column position 20, row position 0, and leaves the cursor positioned there to output the literal main menu. The : character at the end of the statement leaves the cursor positioned immediately to the right of the literal, suppressing the automatic CR/LF combination ordinarily sent out after a print string.

print @(-1): @(20,0): "main menu" :

See Also

: Relational Operator, comment Statement, CRT, crt Statement, Cursor Control Block, devices File, BASIC Functions, input Statement, print Statement, Reserved Characters, setup-printer Command, Statements and Functions, t Command, term Command, Windows Printer Interface