Friday, July 25, 2014

Adds VP Emulation - Cursor On/Off

In case you do not know how…..

In Adds VP emulation : 

Cursor ON is ESC`0
Cursor OFF is (you guessed it) ESC`1 

ESC=CHAR(27) (obviously right?)


The single quote is not a single quote but the character under the Tilde on the keyboard.

Universe Editor Commands


Universe Editor Commands

The EDITOR can be called with the following formats:
ED                           (file and record id's will be prompted)
ED file                   (record id's will be prompted)
ED file id               (edit the record 'id' in 'file')
ED file id id...      (edit multiple id's in 'file')
ED file *                (edit all records in 'file')
SELECT ...            (may precede 'ED file' command)

Special ASCII characters may be entered as:
      ...^nnn...  where nnn is the decimal character code
      ...^^...    will enter a single UP ARROW character.
  An Editor command  ending with a  '?' will be placed on the command stack, but will not be executed.

The following commands may be used in the Editor:
A                             - Do the last 'A any' (APPEND) command again.
A any                     - APPEND 'any' to this line.
ABORT                  - Toggle command execution ABORT between ON and OFF.
B                              - Set the current line pointer to the BOTTOM line.
B any                     - BREAK the current line after 'any' into two lines.
BLOCK                   - Toggle BLOCK operation verification between ON and OFF.
C                             - Do the last 'CHANGE' command again.
C///                       - CHANGE one or more lines.
Formats permitted are:
C/from/to     C/from/to/#
C/from/to/G   C/from/to/#G   C/from/to/G#
C/from/to/B   C/from/to/BG   C/from/to/GB
where  / - is any delimiter character.
from - is the character string to be replaced.
to - is the character string to substitute.
# - is the number of lines to CHANGE.  (The default is one)
G - is the  letter 'G' (global)  CHANGE  all instances  in  line.
B - is the letter 'B',  CHANGE  all lines in the  defined  BLOCK.
CASE                      - Toggle CASE mode between ON and OFF. When CASE is ON,  input will remain in the
  case as typed. When CASE is OFF,  input will be UPCASEd for case insensitivity support.
  TCL CASE insensitivity must be ON to use CASE.
CAT any                - CONCATENATE the next line onto the current line, separated by 'any'.
COL                        - Display relative COLUMN POSITIONS on the CRT.
COPY                    - COPY a BLOCK (see '<' and '>' ), source block is unchanged.
D                            - DELETE the current line.
D#                           - DELETE '#' lines starting with the current line.
DE           - DELETE the current line.
DE#                        - DELETE '#' lines starting with the current line.
DELETE                  - DELETE the entire record from the FILE.
DROP                    - DROP (DELETE) all lines in the defined BLOCK (see '<' and '>' ).
DUP                       - DUPLICATE the current line.
DUP#                    - DUPLICATE the current line '#' times.
EX                           - EXIT the editor (same as QUIT).
F                              - Do the last 'FIND' command again.
any                        - FIND the next line that starts with the string 'any'.
F# any                   - FIND the next line that  contains  the string 'any' starting in column '#'.
FANCY.FORMAT               - Format a BASIC program to show logical structure by indenting.   This command is
   similar to the FORMAT command except that it handles comments and labels
  differently.
FD                           - Delete the entire record from the file (same as DELETE).
FI                            - FILE the record (same as FILE).
FIL                          - FILE the record under the originally specified name.
FILE name           - FILE the record under the specified 'name'.
FILE f name         - FILE record 'name' in file 'f'.
FORMAT              - FORMAT a BASIC program to show logical structure by indenting.
G#                          - GO TO line '#' (set line pointer to line '#';  'G' is optional).
G<                          - GO TO line defined by the beginning of the current BLOCK.
G>                          - GO TO line defined by the end of the current BLOCK.
HELP                      - Prompt user to display HELP information on the CRT.
HELP any              - Display HELP information on CRT for 'any'.
I                               - INSERT new lines AFTER the current line.  Prompt for successive lines of INPUT  until
  NULL input. An INPUT line of a single space will store a NULL line.
IB                            - INSERT new lines BEFORE the current line.  Prompt for successive lines of INPUT until
  NULL input. An INPUT line of a single space will store a NULL line.
I any                      - INSERT (INPUT) the line 'any' AFTER the current line.
IB any                    - INSERT (INPUT) the line 'any' BEFORE the current line.
L                              - Do the last 'LOCATE' command again.
L any                      - LOCATE the next line that contains the string 'any'.
L#                           - LIST '#' lines  starting with  the current  line on to the  CRT.
LOAD name        - LOAD  the record  'name' from the current FILE; line #'s will be prompted.
LOAD f name     - LOAD the record 'name' from file 'f'; line #'s will be prompted.
M            - Do the last 'MATCH' command again.
M any                    - Search for next line that MATCHES the pattern 'any'.
MOVE                   - MOVE a BLOCK (see '<' and '>' ); source block is deleted.
N                             - Go on to next selected record; used when  SELECT list is active.
OOPS                    - RESTORE the  record to the  condition prior to the  last change.
P                             - PRINT on CRT the same number of lines  specified with last 'P#'.
P#                            - PRINT on CRT '#' lines starting with the current line.
PB                           - PRINT on CRT all lines in the defined  BLOCK (see '<' and '>' ).
PE                           - The PE command allows a user to execute  any legal PERFORM command from within
                                  the editor.  Upon completion of the command, control will be returned to the editor.
PERFORM            - The PERFORM command allows a user to execute any legal PERFORM command from
                                   within the editor.  Upon completion of the command, control will be returned to the
                                  editor.
PL#                         - PRINT the current line and the next '#' lines; do not change the current line pointer.
PL-#                       - PRINT  the current  line and the prior '#' lines;  do not change the current line pointer.
PO#                       - POSITION  current line  pointer to line '#'  ('PO' is optional).
PP#                        - PAGE.PRINT a window of '#' lines around the current line; do not change the current
                                  line pointer.
Q                             - QUIT - EXIT the editor.
QUIT                      - QUIT - EXIT the editor.
R                             - Do the last 'REPLACE' (R any) command again.
R any                     - REPLACE this line with 'any'.
R///                       - CHANGE one or more lines (same as C/// command.)
RELEASE               - RELEASE the update record LOCK for this file.
SAVE                     - SAVE  (FILE)  a copy of  this  record  under the original  name.
SAVE name         - SAVE (FILE) a copy of this  record under the  specified  'name'.
SAVE f name      - SAVE (FILE) a copy of this record as record 'name' in  file 'f'.
SEQ///                  - Generate SEQUENTIAL numbers. Formats permitted are:
                                                SEQ/from/start/#   SEQ/from/start/#/inc
                                                 where      / - is any delimiter character.
                                                 from - is the optional character string to replace.
                                                start - is the starting sequential number.
                                                  # - is the number of lines to SEQUENCE, or the letter 'B'
(sequence in defined BLOCK).
inc - is the optional increment (default is one).
SIZE                        - Display the SIZE of this record (# of LINES/FIELDS, # of BYTES).
SPOOL                  - SPOOL entire record to PRINTER.
SPOOL#                - SPOOL '#' lines to the PRINTER.
SPOOLHELP        - SPOOL the HELP listing to the default PRINTER.
STAMP                 - INSERT a 'last modified' stamp into the record, which begins with a '*' (for BASIC
                 'comment'), and contains the account name, LOGIN name  (if  different  from account
                 name), date  and  time.  Used to mark when record was last changed.
T                              - Set current line to the TOP (before first line).
UNLOAD name - UNLOAD to record  'name' in  this  FILE;  line #'s are prompted.
UNLOAD f name- UNLOAD to  record 'name' in  file  'f';  line #'s are  prompted.
X                             - EXIT (QUIT) from the editor and abandon an active SELECT list.
XEQ                        - The XEQ command allows a user to execute any legal PERFORM command from
   within the editor.  Upon completion of the command, control will be returned back to
   the editor.
.A# any                 - Append  'any' to  stack command '#'.  The  default for '#' is 1.
.C#/s1/s2             - CHANGE string  's1'  to  string 's2' in stack  command '#'.  The default for '#' is 1. '/' is
  any delimiter character.
.D#                         - DELETE stack command '#'.  The default for '#' is 1.
.D name               - DELETE pre-stored command record 'name' from file '&ED&'.
.D f name            - DELETE pre-stored command record 'name' from file 'f'.
.I#                           - Prompt for  successive  command lines to INSERT at stack command '#' until null input.
                                   '#' defaults to 1.
.I# any                  - INSERT (INPUT)  'any' at command  stack '#'.  '#' defaults to 1.
.L#                          - LIST,  on the CRT,  the last '#' commands in the  command stack.  '#' defaults to 9.
.L name                                - LIST, on the CRT, the pre-stored command string in record 'name' in file '&ED&'.
.L f name             - LIST, on the CRT, the pre-stored command string in record 'name' in file 'f'.
.L f *                      - LIST, on the CRT, the names of the pre-stored command records in file 'f'.  'f' defaults
                                  to '&ED&'.
.R#                         - RECALL command '#' to  stack position 1 (moves command '#', does not copy it).
.R name               - RECALL pre-stored command record 'name' to the stack.
.R f name             - RECALL  pre-stored  command  record  'name' in  file  'f' to the stack.
.S# name             - SAVE commands, starting with command '#' and ending with command 1 in the stack,
                                  in record 'name' in file '&ED&'.
.S# f name          - SAVE commands, starting with command '#' and ending with command 1 in the stack,
                                  in record 'name' in file 'f'.
.S n s#,e#            - SAVE commands starting with command 's#' and ending with command 'e#' in the
  stack, in  record 'n' in file  '&ED&'. 
For example, '.S n 4,2' saves three commands, with  stack command #4 becoming
pre-stored command #1, in record 'n' in file '&ED&'.
.S f n s#,e#          - SAVE commands starting with command 's#' and ending with command 'e#' in  the
  stack,  in  record 'n' in file 'f'.
For example, '.S n 4,2' saves  three commands, with stack command #4 becoming
pre-stored command #1, in record 'n' in file 'f'.
.X#                         - EXECUTE stack command '#' and put it in stack position 1.
.X name               - EXECUTE the pre-stored commands in record 'name' in file '&ED&'.
.X f name             - EXECUTE the  pre-stored  commands in record  'name' in file 'f'.
.XK                         - EXECUTE KILL.  This command ABORTs a  pre-stored command string after execution is
                                  suspended by a PAUSE command.
.XR                         - EXECUTE RESUME.  This command RESTARTs a pre-stored command string after
                                  execution is suspended by a PAUSE command.
PAUSE                  - Is a pre-stored command string command  (i.e.  It is valid only within the pre-stored
  command string itself) that suspends command execution when encountered.  A '.XR'
  command restarts execution and a '.XK' command aborts execution.
LOOP #1 #2         - Is a pre-stored command  string command  (i.e.  It is valid only within the pre-stored
  command string itself) that repeats the sequence of commands beginning with
  command '#1' and ending with  the LOOP command itself, for '#2' iterations. Both '#1'
  and '#2' default to 1.
+#                           - Advance current line POINTER by '#' lines.
-#                            - Back up current line POINTER by '#' lines.
#                             - Set the current line POINTER to the '#' line.
<                             - Define the first line of a BLOCK (for COPY/CHANGE/DROP/MOVE/PB).
>                             - Define the last line of a BLOCK  (for COPY/CHANGE/DROP/MOVE/PB).
<>                           - Define first  and last line  of a  BLOCK (for  COPY/CHANGE/DROP/MOVE/PB).
^                             - Switch  UP ARROW  on/off to display  non-printing  characters as ^nnn  where  nnn  is
  the  decimal  equivalent  of  ASCII  code.
?                              - PRINT key parameters on the CRT.


D3 Break Key


At TCL:

set-break
Break value x'1C' (decimal 28)
Displays the current definition for the <break> key.

set-break 3
Break value x'03' (decimal 3)
Previous value x'1C' (decimal 28)
Defines the <break> key as <ctrl>+c.

set-break esc
Break value x'1B' (decimal 27)
Previous value x'03' (decimal 3)
This defines the <escape> key as the <break> key.


If you need to set it permanently, you can place this in the user-coldstart proc

AccuTerm Coding Tips and Tricks



Here are some Accuterm code snippets I keep around…  I find it very useful. (I don’t like documentation, so these cliff notes helps a lot!

Cursor Position – Check out Session.Col / Session.Row:

SCR='InitSession.Output CStr(InitSession.Col) & "," & CStr(InitSession.Row) & vbCr'

PRINT CHAR(27):CHAR(2):'P':SCR:CHAR(13):

INPUT CPOS:

CCOL=FIELD(CPOS,',',1)

CROW=FIELD(CPOS,',',2)



I have used a method that might save you some time/effort with lookup screens and repainting.

I include a statement in the code before the screen changes like:

PRINT ESC : STX : “jS,1” : CR:   (This save the screen to ID#1)  The S in jS is capitalized!

Print you lookup screen code here…..

When done, use this code to restore the screen without repainting :

PRINT ESC : STX : “jR,1,,,,1” : CR:   (This will restore the screen before the lookup popup, etc.) The R in jR is capitalized!

You can then do a :

PRINT ESC : STX : “jD,1” : CR :  (This will delete the screen from memory) The D in jD is capitalized!

If you have any questions, let me know.  I use this in the Image Indexing program so when I lookup a part number in a lookup screen overlay, I do not have to worry about repainting the screen.  It is SOOOOOO much faster and slicker too!



AccuTerm 7 supports many "private" commands which may be sent by host application programs. These commands allow for remote control of file transfer and data capture, executing DOS or Windows programs, enabling the mouse, displaying images, playing sounds, executing VBA scripts, and programming the function and keypad keys. These commands are valid in all terminal types.

External Program Execution

ESC STX < command CR

Executes the Windows command line command, then returns to AccuTerm emulation mode immediately. Command is executed concurrently with the terminal session. Command may also be the file name of a document that is registered with Windows. If command is a document file name, the program associated with the specified file is used to open the file. For example, if the file name ends in ".doc", Microsoft Word is used to open the specified document file. You can also use this function to open a URL in the default browser (be sure to include the http:// prefix in the URL):

EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13)
CMD = "calc.exe"
PRINT ESC:STX:'<':CMD:CR:

ESC STX > command CR

Executes the Windows command line command and suspends the terminal session until the command completes. See above for details.
Note: when using this function, you often need the host program to wait until the command terminates. If you require this functionality, then you should send the ESC STX I command immediately following the ESC STX > command, and then wait for input. AccuTerm will not process the ESC STX I until the command terminates. After the command completes, ESC STX I transmits AccuTerm's licensing information back to the host, thus the input is satisfied and the host program can continue execution:

EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13)
CMD = "notepad.exe"
PRINT ESC:STX:'>':CMD:CR:
PRINT ESC:STX:'I':
INPUT JUNK


Mouse Functions

ESC STX 0

Disable mouse input; turns off mouse cursor.

ESC STX 1

Enable mouse input; turns on mouse cursor. Transmits mouse location whenever a mouse button is pressed. Both single and double clicks are supported. A single-click will always precede a double-click. Note: this command is ignored unless host mouse reporting is enabled in the Mouse Settings.
The format of the mouse click report depends on whether the current terminal type uses ASCII or ANSI-style function keys. The report is designed to look like a function key, followed by the click position. For terminal types with ASCII-style function keys, the report is:

STX b CR ccc.rr CR

where b indicates which mouse button was pressed (p=left click, q=right click, r= center click, P=left double click, Q=right double click, R=center double click), ccc is the three digit column of the mouse cursor and rr is the two digit row of the mouse cursor (both in decimal, 000.00 is the upper left corner).

For terminal types with ANSI-style function keys, the report is:

ESC [ n ~ ESC [ r ; c R

where n indicates which mouse button was pressed (101=left click, 102=right click, 103=center click, 111=left double click, 112=right double click, 113=center double click), r is the row of the mouse cursor and c is the column of the mouse cursor (both in decimal, where 1;1 is the upper left corner). If the terminal is using 8-bit control codes, AccuTerm sends CSI instead of ESC [. in this report.
Note: if the mouse is clicked on an image that is displayed on the terminal screen, the location in the above reports is replaced by the image file name.

ESC STX 2
SystemBuilder compatibility mode; turns on mouse cursor. Transmits mouse location whenever a mouse button is pressed. Note: this command is ignored unless host mouse reporting is enabled in the Mouse Settings.

STX ~ CR b ; c ; r CR

b indicates which mouse button was pressed (1 = left, 2 = right, 4 = center), c is the column of the mouse cursor and r is the row of the mouse cursor (both in decimal, 0;0 is the upper left corner).

ESC STX h CR
Resets the mouse pattern table used for mouse pattern matching.

ESC STX h button HT pattern HT click HT dblclk CR
Adds an entry to the mouse pattern table used for mouse pattern matching. See Mouse Support for more information about using mouse pattern matching.


Data Transfer

ESC STX D p o m ; path CR
Download file from host to PC. Protocol p may be A (ASCII), K (Kermit), X (Xmodem), Y (Ymodem) or Z (Zmodem); Overwrite o may be O (overwrite) or N (no overwrite) or, if protocol is Z, overwrite may be R; Mode m may be T (text) or B (binary). Path is the drive, directory and file name of the file being received. When using Kermit, Ymodem or Zmodem protocols, only drive and directory need be specified, as the file name is included in the transfer protocol; however if the file name is specified here, it overrides the file name included in the transfer protocol.

Note: the download command is typically used by applications which implement the host side of the file transfer protocol to automatically start the corresponding client protocol. This command only affects the client (AccuTerm) side of the process.

ESC STX U p m ; path CR
Upload file from PC to host. Protocol p may be A (ASCII), K (Kermit), X (Xmodem), Y (Ymodem) or Z (Zmodem); Mode m may be T (text) or B (binary). Path is the drive, directory and file name of the file to send to the host. Wildcard characters (* or ?) are valid when using Kermit, Ymodem or Zmodem protocols.

Note: the upload command is typically used by applications which implement the host side of the file transfer protocol to automatically start the corresponding client protocol. This command only affects the client (AccuTerm) side of the process.

ESC STX S
Returns status of last file transfer. The format of the status message is:

Status: s files f bytes b CR

where f is the number of files transferred, b is the number of bytes transferred, and s is the transfer status:

0 = transfer successful
1 = unable to open file
2 = transfer aborted by operator
3 = file already exists
4 = terminated due to timeout
5 = terminated due to corrupted data
6 = invalid packet type
7 = terminated by remote program
8 = 8 data bits required for protocol
9 = software flow control not allowed for protocol
10 = destination file is write protected

ESC STX C o p t ; path CR
Begin capture. Mode o may be O (overwrite), A (append), N (new file only) or C (clipboard). Source p may be P to capture printed data or null to capture received data. T may be T (text) to capture text only (filters out control characters) or null for no filtering. Path is the drive, directory and file name where the captured data is to be stored. All characters received (or printed) are stored in the file (or clipboard) until capturing is disabled (via local or remote command). Note: when capturing to the clipboard, path is ignored.

ESC STX C X
End capture. The file containing the captured data is closed.

ESC STX Y path CR
Send clipboard or file to host. If path is null, the contents of the clipboard are sent, otherwise the specified file is sent. Each line is terminated as specified in the ASCII file transfer settings. A SUB (CTRL+Z) is sent after the last line.


Status and Control

ESC STX I
Returns AccuTerm release, serial number, type and licensee information. Message format is:

ACCUTERM/WIN rel serial type licensee... CR

where rel is the AccuTerm release number, serial is the program serial number, type is SINGLE, SITE, CORP, DEALER or DEMO, and licensee is the name under which the program has been licensed.

ESC STX ?
Returns a string indicating the platform, product type, license type, capabilities and automation services. Message format is:

platform * product * license * capabilities * services CR

where platform is 3 (Win32); product is 4 = AccuTerm (standard version), 5 = AccuTerm Internet Edition, 6 = AccuTerm Emulator ActiveX Control, 7 = AccuTerm Lite; release number, serial is the program serial number, license is 1 = single user, 2 = site, 3 = enterprise, 5 = developer, 7 = internet, 8 = component, 9 = evaluation; capabilities is a string of letters indicating the various capabilities where:

A = ASCII protocol supported
B = Border effects (visual styles) enabled
C = Capture supported
D = Download supported
E = Execute command supported
G = GUI supported
H = Server mode supported
I = Image display supported
J = Screen save & restore supported
K = Kermit protocol supported
L = Background image supported
O = Object Bridge supported
P = Packetized messages supported
Q = Message integrity checks supported
R = Reliable connection
S = Scripting supported
T = File transfer error info supported
U = Upload supported
V = Host capabilities command supported
W = Synchronous script execution supported
X = File conversion supported
Y = Printer control & status query supported

services is a string of letters indicating which automation services are available (a = Object Bridge, b = file converter, g = GUI).

ESC STX = host-capabilities * buffer-size CR
Informs AccuTerm of any special host program capabilities. host-capabilities is a string of letters indicating various host features:
D = host programs use tag notation for system delimiters
C = host supports message checksums
M = host supports message length check
buffer-size is optional, and specifies the maximum packet size that the client can send to host.

ESC STX % 0
Returns the program directory, followed by CR. This is normally the directory where AccuTerm is installed, except in the case of AccuTerm Internet Edition, the directory returned is the one containing the Internet Explorer exe file.

ESC STX % 1
Returns the current directory (usually from the shortcut "start in" field), followed by CR.

ESC STX % 2
Returns the directory containing AccuTerm's atwin70.ini file, followed by CR.

ESC STX % 3
Returns the directory containing AccuTerm's emulator DLL, followed by CR.

ESC STX X
Terminates the current AccuTerm session. If only one session exists, then AccuTerm is terminated also.

ESC STX W
Saves the current session settings to disk. If no session file name exists, then one will be prompted for.

ESC STX L
Sets the CapsLock key state to "On"

ESC STX M
Sets the CapsLock key state to "Off"


Terminal Screen

ESC STX E
Selects extended (132 column) screen size as defined by the extended columns and rows in the screen settings.

ESC STX N
Selects normal (80 column) screen size as defined by the normal columns and rows in the screen settings.

ESC STX A color CR
Sets the foreground (text) color to color. This command overrides the foreground color assigned by the last visual attribute selected.

ESC STX B color CR
Sets the background color to color. This command overrides the background color assigned by the last visual attribute selected.

Color
Display
0
Black
1
Dark Blue
2
Dark Green
3
Turqoise
4
Dark Red
5
Purple
6
Olive
7
Light Gray
8
Dark Grey
9
Blue
10
Green
11
Cyan
12
Red
13
Magenta
14
Yellow
15
White

Note: the actual display color may vary from the color shown in the table, since it is possible to modify the palette (see Color Settings).

ESC STX r x1 , y1 , x2 , y2 , fill , border CR
Draw rectangle. x1, y1 is the upper-left corner and x2, y2 is the lower-right corner. Coordinates are in character columns and rows. The upper-left corner of the screen is (0,0).
The rectangle can be filled using either a visual attribute or a background color. To fill with a visual attribute, fill is A0 .. A63. The attribute number is formed by adding the following values:

0 = normal
1 = invisible
2 = blinking
4 = reverse
8 = underline
16 = dim
32 = bright

To fill with a background color (as described above), fill is B0 ... B15. To draw a border without filling the rectangle, fill is N. A border can be drawn around the rectangle. Border is N (no border), B (flat border), I (inset border) or R (raised border).

ESC STX jS , ID , col , row , width , height , page CR
Saves a copy of the specified screen block (text, colors and visual effects) and terminal state in memory and associates the block with the specified identifier (ID) which can be an arbitrary alpha-numeric string (may not contain commas). Any number of screen blocks can be saved. Col and row specify the upper-left corner of the block. If either is omitted or null, zero is assumed. Width and height specify the size of the block. If width or height is omitted or null, the screen width or height is used. Page optionally specifies the terminal page for the block, and if omitted or null, the current page is used.

ESC STX jR , ID , col , row , page CR
Restores the screen block associated with the specified identifier (ID) to the screen. Col and row specify the upper-left corner of the destination. If either is omitted or null, the original position of the saved block is assumed. Page optionally specifies the terminal page for the destination, and if omitted or null, the current page is used.

ESC STX jD , ID CR
Deletes the screen block associated with the specified identifier (ID) from memory.

ESC STX yj, ID CR
Queries status of a stored screen block. Sends a 0 or 1, followed by a CR, indicating if a block of the specified identifier (ID) exists in AccuTerm's screen block memory.


Keyboard

ESC STX F t s d k data CR
Program function and keypad keys. Type t may be N (normal function keys), C (control function keys), A (ALT function keys) or K (keypad keys). Shift s may be U (unshifted) or S (shifted). Destination d may be null (program key) or T (program function bar button caption). Key code k may be digits 0 to 9 or : ; < = > according to the following table. Data contains the function key data (or caption text). Normally, the key data is transmitted to the host when the programmed key is pressed. However, if data is enclosed in brackets ( [ ] ), then when the key is pressed, the key data will be interpreted as a VBA script statement and will be executed instead of being sent to the host.

Key
Code
Function
key
Editing
key
0
F1
BKSP
1
F2
TAB
2
F3
INS
3
F4
DEL
4
F5
HOME
5
F6
END
6
F7
PGUP
7
F8
PGDN
8
F9
LEFT
9
F10
RIGHT
:
F11
UP
;
F12
DOWN
<

ESC
=

ENTER
>

KPD ENTER

To enter control characters (and special prefix characters) in key data, use the notation shown in the following table:

Key
sequence
Control
code
AccuTerm
notation
Key
sequence
Control
code
AccuTerm
notation
CTRL + @
NUL
^@
CTRL + P
DLE
^P
CTRL + A
SOH
^A
CTRL + Q
DC1
^Q
CTRL + B
STX
^B
CTRL + R
DC2
^R
CTRL + C
ETX
^C
CTRL + S
DC3
^S
CTRL + D
EOT
^D
CTRL + T
DC4
^T
CTRL + E
ENQ
^E
CTRL + U
NAK
^U
CTRL + F
ACK
^F
CTRL + V
SYN
^V
CTRL + G
BEL
^G
CTRL + W
ETB
^W
CTRL + H
BS
^H
CTRL + X
CAN
^X
CTRL + I
HT
^I
CTRL + Y
EM
^Y
CTRL + J
LF
^J
CTRL + Z
SUB
^Z
CTRL + K
VT
^K
CTRL + [
ESC
^[
CTRL + L
FF
^L
CTRL + \
FS
^\
CTRL + M
CR
^M
CTRL +]
GS
^]
CTRL + N
SO
^N
CTRL + ^
RS
^~
CTRL + O
SI
^O
CTRL + _
US
^_
^

^^
\

\\
DELETE
DEL
^?




For example, to program the END key to send the word "END", followed by a carriage return, the following code could be used:

EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13)
PRINT ESC:STX:'FKU5END^M':CR:


Printer

ESC STX p mode CR
Selects the printer mode:
mode = 0 - turns off auto or transparent print
mode = 1 - turns on auto (copy) print mode
mode = 2 - turns on transparent print mode
mode = X - turns off auto or transparent print and closes the print job immediately


Multimedia

ESC STX iL , filename , col , row , width , height , aspect, border CR
Displays the image file filename at column col and row row. Height and width are optional; if specified (and not zero), the image is scaled to height rows and width columns. Otherwise, the original image size is used. If aspect is non-zero, the image aspect ratio is preserved (the specified width or height is reduced to preserve the aspect ration). Border is N for no border, B for simple border, R for raised border or I for inset border style. Image file types supported include BMP, JPEG, GIF, PCD, PCX, PICT, PNG, PSD, TARGA, TIFF, WBMP, XBM, XPM and Windows Metafile. Images are considered "protected" data; a "clear un-protected characters" command will not clear images from the terminal screen.

The image file does not need to be a local file; if an internet connection is available the filename can specify a URL instead of a local or network file.

Note: AccuTerm 7 uses the FreeImage Open Source image library.

ESC STX iD , filename CR
Removes the displayed image file filename from the screen.

ESC STX iC CR
Clears all displayed images from the screen.

ESC STX iB, filename,scalemode,opacity CR
Loads an image to use as the screen background (wallpaper).
filename - the path or URL of the image to use as the screen background.
scalemode = 0 - picture is stretched to fit screen size. This may alter the picture's aspect ratio.
scalemode = 1 - picture is scaled so that its longest dimension fills the screen. The area not filled by the picture is black.
scalemode = 2 - picture is scaled so that its shortest dimension fill the screen. The longer dimension is cropped.
opacity - specifies the opacity of the background image, as a percentage. 100 means that the picture is opaque. 0 means that the image is invisible (transparent) and the screen background color is used as the background. Any percentage in between blends the image with the screen background color.

To clear the background image, simply use ESC STX iB CR.

ESC STX m filename CR
ESC STX w filename CR
Plays sound file filename. The file does not need to be a local file; if an internet connection is available the filename can specify a URL instead of a local or network file. Supported sound file formats are WAVE, MIDI and MP3.


Scripting

ESC STX P statements CR
Executes VBA script statements. See Scripting for details on VBA scripting. Multiple statements may be executed; separate each statement with LF or EM control characters. You can call subroutines or functions contained within the script loaded in the Main Script tab of the Script Editor window. For example, to call subroutine FOO, simply send: ESC STX P FOO CR . You can execute a script stored in a script file (.atsc file) by using the Chain statement:

EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13)
FILENAME = 'myscriptfile.atsc'
SCRIPT = 'Chain "':FILENAME:'"'
PRINT ESC:STX:'P':SCRIPT:CR:

ESC STX R statements CR
Executes VBA script statements (see above) except that the script is synchronized with the terminal state. This basically sets the session's InputMode property to 1 before the script starts and restores it once the script completes. This ensures that any characters received from the host will not be processed by the terminal emulator unless they are first processed in the script using Input or WaitFor functions. This has the effect of buffering any data, control codes or escape sequences received while the script is running. This is useful when changing Session properties such as screen sizes, terminal type, etc.

Note: in previous versions of AccuTerm, synchronization required adding a final Output method in the script and corresponding INPUT statement in the host program. However, this technique is not compatible with typeahead on the host and is less efficient than ESC STX R and is no longer recommended.