PURPOSE: The TRANSMIT command is used to send device controls to video terminals and displays, remote printers, plotters, and other devices. This command can also be used as a statement in a PM.
TRANSMIT FROM {NORMAL;ASCII;BYTE} FROM source [MAX ae]
{/CHARS/; /CHARACTERS/;/BYTES/}]
NORMAL |
permits the transmission of only the 95 printing ASCII characters and the codes Control-M (return), Control-J (line feed), Control-I (tab), Control-L (form feed), Control-S, Control-P, Control G (bell), and Control-Shift-K (escape). All other codes are disregarded and not sent. |
ASCII |
permits the transmission of all 128 ASCII codes except a null. |
BYTE |
transmits all 8-bit numeric codes. |
source |
may be either a string expression, a character data field defined with or without an OCCURS clause, or a binary integer or bit data field optionally defined with a single-dimension OCCURS clause. |
MAX |
specifies a maximum integer ae number of objects that will be transmitted from source. The default number of objects is one of the following: The length of a string expression. The length of a C field occurrence. The state of ENABLE FIELDTRIM affects this value. One object will be transmitted per binary I data word. Each object transmitted will be from the right most 7 (or 8 if BYTE mode) bits. One object will be transmitted per BB element. A BB element size must be at least 7 bits. |
The following illustrates some sample usage.
10 DECLARE SECTION
20 CHOME, CHAR, 2
30 TWORD, INT, 3, OCCURS 5
40 DETAILS SECTION
50 @ESC + "H" TO CHOME
60 27 TO TWORD(1); @ASC "H" TO TWORD(2)
70 TRANSMIT ASCII FROM CHOME
80 TRANSMIT ASCII FROM @ESC + "H"
90 TRANSMIT ASCII FROM TWORD MAX 2
Lines 70, 80, and 90 all transmit the same sequence to the user’s terminal; this sequence will home the cursor on many popular video display terminals.
NOTES: Due to the special data modes used by ACCENT R for TRANSMIT, the objects transmitted will not appear in an ACCENT R LOG file.
A string expression or a sole character field specified for source may only be used with the NORMAL and ASCII data modes.
If the MAX ae evaluates to a negative or zero value, nothing will be transmitted. If the MAX ae evaluates to a value greater than the length of source, the present length of source will be used instead.
The specification of a sole binary integer or bit field for source may not include a subscript; objects are transmitted from the first element up to either the implied or explicit MAX.
ACCENT R’s ENABLE FIELDTRIM (the default) may be used to great advantage when a complex string expression has been constructed and placed into a character field for transmission; trailing nulls or spaces will not be transmitted.
The use of certain system fields such as @ESC, @LF, @TAB, @BS, @VT, @NUL, @FF, and @RUB aid the construction of string expressions for driving certain devices. For example.
TRANSMIT NORMAL FROM @ESC + "H"
will home the cursor on many video terminals.
SEE ALSO: TYPE, PRINT