basic.@.functions Function/BASIC Program

basic.@.functions

Command basic.@.functions Function/BASIC Program
Applicable release versions: AP
Category BASIC Program (486)
Description provides a standard means of performing control functions on a wide array of terminals.

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 verb, "define-terminal".

@(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 leftmost column is column 0. The rightmost column is determined by the TCL "term" command terminal width setting.

@(column,row) This "@" function 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 topmost 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 an @(column,row) function on output to a printer can have unpredictable results.

Note: many of the following functions will not behave properly unless the "term type" setting of the "term" verb corresponds to the "emulation type" currently defined in the terminal.

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

@(-2) Positions to "home" cursor position: column 0, row 0.

@(-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 written 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. Characters are now "protected" from being overwritten by data entry. Usually, the 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) Cursor back. Moves the character one position to the left (non-destructively). What happens at the margin depends on the brand of terminal. It may either stay at the margin, or "wrap" to the last position on the previous line.

@(-10) Cursor Up. Moves the cursor up one position upwards (non-destructively). What happens at the top row depends on the brand of terminal. It may either stay on the top row, or "wrap" back to the bottom row.

@(-11) Enables Protect Mode. Enables the terminals ability 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. Begins "reverse-video" mode. The Foreground color is changed to the Background color, and vice-versa. This mode remains in effect until it is terminated by the @(-14) function. The Output processor uses this mode as "boldface-on" mode.

@(-14) Stops Reverse Video. Terminates "reverse-video" mode.

@(-15) Begins "underline" mode. All characters written after this command will be underlined. This mode is terminated by the @(-16) function.

@(-16) Terminates "underline" mode.

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

@(-18) Terminates "slave-printer" mode.

@(-19) Cursor Forward. Moves the cursor one position to the right (non-destructively). What happens at the margin depends on the brand of terminal. The cursor will either stay at the margin, or it will "wrap" to the first column on the following line.

@(-20) Cursor Down. Moves the cursor one position downwards (non-destructively). What happens at the margin depends on the brand of terminal. The cursor will either stay at the at the bottom row, or it will "wrap" back up to the top row.

@(-21) Graphics Character Set On. Enables the terminals ability to accept and display graphics characters (char-128 through char-255). This mode remains in effect until it is terminated by a @(-22) function. NOTE: Also see the TCL command "xcs-on".

@(-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 terminals ability to accept input from the keyboard.

@(-25) Control Character Enable. Enables the terminals ability to accept and transmit control characters (char-00 through char-31). Advanced Pick does not re-display control characters.

@(-26) Control Character Disable. Disables the terminals ability to accept and transmit control characters.

@(-27) Write Status Line. Positions the cursor to the "status line", and writes the text that follows on that line. The "status line" is the bottom line of the terminal display which is not considered part of the active display area; that is, it does not erase when a "clear-screen" command is issued, nor is the line used for data input. This line is usually used as a Legend for the top row of function keys, or as a status display of various information.

@(-28) Erase Status Line. Positions the cursor to the "status line", and erases any data on the status line.

@(-29) Initialize Terminal Mode. Resets (initializes) the terminal back 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, so when a function key is pressed, a (previously-defined) string of keystrokes will be transmitted.

@(-31) Non-Embedded Stand-Out On. Enables the terminals ability to display (normally hidden) terminal display attribute codes.

@(-32) Non-Embedded Stand-Out Off. Disables the terminals ability to display (normally hidden terminal display attribute codes.

Functions @(-33) through @(-40) set color terminals background colors. See also the TCL "color" command.

@(-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) Background Color = BLUE

@(-40) Set Background Color = BLACK

Functions @(-41) through @(-48) set color terminals foreground colors to a full-intensity color. See also the TCL "color" command.

@(-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) through @(-56) (Reserved)

Functions @(-57) through @(-64) set color terminals foreground colors to a low-intensity color. See also the TCL "color" command.

@(-57) Set Foreground Color = WHITE

@(-58) 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) through @(-86) (Reserved)

@(-87) Set to full-intensity white background.

@(-89) Activate monochrome monitor to 80x25 mode. Sets the terminal to Black & White in 80 columns by 25 rows mode. See also the TCL "mono" command.

@(-90) through @(-92) (Reserved)

@(-93) Activate color monitor to 80x25 mode. Sets the terminal to Color 80 columns by 25 rows mode. See also the TCL "color" command.

@(-94) Activate color monitor to 80x25 B&W mode. Sets the terminal to Black & White in 80 columns by 25 rows mode. See also the TCL "mono" command.

@(-95) through @(-99) (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 rather a way to notify the program that the terminal does or does not use a space in visual attributes, so it can properly keep track of the current cursor position.

"0" = Visual Attributes are "hidden".
"1" = Visual Attributes are "embedded".

@(-100) Half Intensity. Sets the foreground brightness to half-intensity. All characters written after this command will now be at half-intensity. This mode remains in effect until it is changed by the @(-101) function. Function @(-7) usually has the same visual effect, depending on the terminal.

@(-101) Full Intensity. Sets the foreground brightness to full-intensity. All characters written after this command will now be at full-intensity. This mode remains in effect until it is changed by the @(-100) function. Function @(-8) usually has the same visual effect.

@(-102) Italics On. Enables "italics" mode. All characters written after this command will now be in italics. This mode remains in effect until it is terminated by the @(-103) function.

@(-103) Italics Off. Terminates "italics" mode.

@(-104) Shift Half-Line Downwards. Shifts the line printing by a half-line downwards (for printing subscripts). All characters written after this command will be written as subscripts until they are terminated by the @(-105) function.

@(-105) Shift Half-Line Upwards. Shifts the line printing by a half-line upwards (for printing superscripts). All characters written after this command will be written as a superscript until it is terminated by the @(-104) function.

@(-106) Insert line. Used by the Update processor for backwards scrolling.

@(-107) Delete line.

@(-108) through @(-109) (Reserved)

@(-110) Resets the printer back to its original power-on settings.

@(-111) (Reserved)
@(-112) (Reserved)

@(-113) Set Vertical Motion Index. Sets the height of a single line by specifying how many "units" to skip down before printing the next line. The "units" differ between devices, but they are usually in 48ths, 72nds, or 300ths of an inch.

@(-114) Set Lines Per Inch. Sets the height of a single line by specifying how many "lines" will be 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, which may be different.

@(-115) Character Printing: Enlarged. Sets the character width to "enlarged". Assuming the standard character set is 10 chars per inch, the "enlarged" characters will be 5 chars per inch.

@(-116) Character Printing: Condensed. 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) Character Printing: Proportional. Sets the character width to "proportional". The "proportional" character set's width will vary depending on the width of each individual character.

@(-118) Perf Skip On. Enables the printer's ability to "skip over" the page perforation on continuous forms. This may 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) Perf Skip Off. Terminates "perf skip" mode.

@(-120) through @(-124) (Reserved)

@(-125) Set 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) Set Default Font. Specifies which font is to be the default font. This function is also issued by Access at the beginning of each printed report.

The @(-127) through @(-241) functions involve selecting / downloading fonts to a LASER printer.

@(-127) Specifies or downloads Font #1

@(-128) Specifies or downloads Font #2

@(-129) Specifies or downloads Font #3

@(-130) Specifies or downloads Font #4

@(-131) Specifies or downloads Font #5

@(-132) Specifies or downloads Font #6

@(-133) Specifies or downloads Font #7

@(-134) Specifies or downloads Font #8

@(-135) Specifies or downloads Font #9

@(-136) Specifies or downloads Font #10

@(-137) Specifies or downloads Font #11

@(-138) Specifies or downloads Font #12

@(-139) Specifies or downloads Font #13

@(-140) Specifies or downloads Font #14

@(-141) Specifies or downloads Font #15

@(-150) Specifies or downloads Font #16

@(-151) Specifies or downloads Font #17

@(-152) Specifies or downloads Font #18

@(-153) Specifies or downloads Font #19

@(-154) Specifies or downloads Font #20

@(-155) Specifies or downloads Font #21

@(-156) Specifies or downloads Font #22

@(-157) Specifies or downloads Font #23

@(-158) Specifies or downloads Font #24

@(-159) Specifies or downloads Font #25

@(-160) Specifies or downloads Font #26

@(-161) Specifies or downloads Font #27

@(-162) Specifies or downloads Font #28

@(-163) Specifies or downloads Font #29

@(-164) Specifies or downloads Font #30

@(-165) Specifies or downloads Font #31

@(-166) Specifies or downloads Font #32

@(-167) Specifies or downloads Font #33

@(-168) Specifies or downloads Font #34

@(-169) Specifies or downloads Font #35

@(-170) Specifies or downloads Font #36

@(-171) Specifies or downloads Font #37

@(-172) Specifies or downloads Font #38

@(-173) Specifies or downloads Font #39

@(-174) Specifies or downloads Font #40

@(-175) Specifies or downloads Font #41

@(-176) Specifies or downloads Font #42

@(-177) Specifies or downloads Font #43

@(-178) Specifies or downloads Font #44

@(-179) Specifies or downloads Font #45

@(-180) Specifies or downloads Font #46

@(-181) Specifies or downloads Font #47

@(-182) Specifies or downloads Font #48

@(-183) Specifies or downloads Font #49

@(-184) Specifies or downloads Font #50

@(-185) Specifies or downloads Font #51

@(-186) Specifies or downloads Font #52

@(-187) Specifies or downloads Font #53

@(-188) Specifies or downloads Font #54

@(-189) Specifies or downloads Font #55

@(-190) Specifies or downloads Font #56

@(-191) Specifies or downloads Font #57

@(-192) Specifies or downloads Font #58

@(-193) Specifies or downloads Font #59

@(-194) Specifies or downloads Font #60

@(-195) Specifies or downloads Font #61

@(-196) Specifies or downloads Font #61

@(-197) Specifies or downloads Font #63

@(-198) Specifies or downloads Font #64

@(-199) Specifies or downloads Font #65

@(-200) Specifies or downloads Font #66

@(-201) Specifies or downloads Font #67

@(-202) Specifies or downloads Font #68

@(-203) Specifies or downloads Font #69

@(-204) Specifies or downloads Font #70

@(-205) Specifies or downloads Font #71

@(-206) Specifies or downloads Font #72

@(-207) Specifies or downloads Font #73

@(-208) Specifies or downloads Font #74

@(-209) Specifies or downloads Font #75

@(-210) Specifies or downloads Font #76

@(-211) Specifies or downloads Font #77

@(-212) Specifies or downloads Font #78

@(-213) Specifies or downloads Font #79

@(-214) Specifies or downloads Font #80

@(-215) Specifies or downloads Font #81

@(-216) Specifies or downloads Font #82

@(-217) Specifies or downloads Font #83

@(-218) Specifies or downloads Font #84

@(-219) Specifies or downloads Font #85

@(-220) Specifies or downloads Font #86

@(-221) Specifies or downloads Font #87

@(-222) Specifies or downloads Font #88

@(-223) Specifies or downloads Font #89

@(-224) Specifies or downloads Font #90

@(-225) Specifies or downloads Font #91

@(-226) Specifies or downloads Font #92

@(-227) Specifies or downloads Font #93

@(-228) Specifies or downloads Font #94

@(-229) Specifies or downloads Font #95

@(-230) Specifies or downloads Font #96

@(-231) Specifies or downloads Font #97

@(-232) Specifies or downloads Font #98

@(-233) Specifies or downloads Font #99

@(-234) Specifies or downloads Font #100

@(-235) Specifies or downloads Font #101

@(-236) Specifies or downloads Font #102

@(-237) Specifies or downloads Font #103

@(-238) Specifies or downloads Font #104

@(-239) Specifies or downloads Font #105

@(-240) Specifies or downloads Font #106

@(-241) Specifies or downloads Font #107

@(-242) Font Parameter - Point Size
@(-243) Font Parameter - Point Size

@(-244) Font Parameter - Pitch
@(-245) Font Parameter - Pitch

@(-246) Font Parameter - Style - Reverse-Off & Italics-Off
@(-247) Font Parameter - Style - Reverse-Off & Italics-On

@(-248) Font Parameter - Block
@(-249) Font Parameter - Reverse
@(-250) Font Parameter - Black

@(-251) through @(-255) (Reserved)

@(-256) Font Parameter - Stroke - 1 (L. Light)
@(-257) Font Parameter - Stroke - 2 (M. Light)
@(-258) Font Parameter - Stroke - 3 (H. Light)
@(-259) Font Parameter - Stroke - 4 (L. Medium)
@(-260) Font Parameter - Stroke - 5 (M. Medium)
@(-261) Font Parameter - Stroke - 6 (H. Medium)
@(-262) Font Parameter - Stroke - 7 (L. Bold)
@(-263) Font Parameter - Stroke - 8 (M. Bold)
@(-264) Font Parameter - Stroke - 9 (H. Bold)
@(-265) Font Parameter - Stroke -10 (V. Bold)

@(-266) Font Parameter - Spacing - Proportional
@(-267) Font Parameter - Spacing - Fixed

@(-268) (Reserved)

@(-269) 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).

@(-270) Font Parameter - Orientation - Portrait

@(-271) Font Parameter - Orientation - Landscape (sideways)

@(-272) through @(-300) (Reserved)

Note: If additional, customized @() functions are added, it is recommended that they start at @(-1001) or so. This is to ensure that they do not conflict with existing or future functions.
Syntax @(num.expression{,num.expression})
Options
Example
The following program 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 following example 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 carriage return/linefeed 
combination ordinarily sent out after a print string.

print @(-1) : @(20,0) : "main menu" :
Purpose
Related basic.statements
basic.print
basic.crt
tcl.term
tcl.color
basic.special.characters
proc.t
tcl.setup-printer
basic.@
tcl.comment
basic.functions
basic.:
cursor.control.block
filename.devices
crt
basic.input@