Use the $3270() function to convert English commands and data into a 3270-compatible data stream. Information is passed to the function both as arguments and on the current stack.
The $3270() function has this syntax:
stream = $3270([rows],[cols],[{WRITE|ERASE|NONE}],[{ALARM|RESET|RESTORE}])
The $3270() function takes these arguments:
|
stream |
3270 data stream. This data stream is prefaced by both a command byte and a Write Control Character (WCC). |
|
rows |
Number of rows on the screen. The default value is determined by the Logon Facility. |
|
cols |
Number of columns on the screen. The default value is determined by the Logon Facility. |
|
WRITE |
Indicates that the finished data stream is intended to be written without first erasing the display. The new data will overlay and selectively replace the existing data. |
|
ERASE |
Indicates that the finished data stream is intended to completely replace any existing display. |
|
NONE |
Indicates that the finished data stream does not contain either a command or WCC. The returned data may be appended to another stream that does begin with a command and WCC. This is the default. |
|
ALARM |
Sets the Sound audible alarm flag in the WCC. This may appear in combination with RESTORE and RESET, separated by blanks. |
|
RESTORE |
Sets the Restore keyboard flag in the WCC. This may appear in combination with ALARM and RESET, separated by blanks. |
|
RESET |
Sets the Reset modified data tag flag in the WCC. This may appear in combination with RESTORE and ALARM, separated by blanks. |
Commands are passed to $3270() using the current stack. Each command and its accompanying arguments must be complete in one stack record. Multiple commands may appear in a single stack record. Except where otherwise specified, commands and arguments are separated by blanks. Commands may be uppercase or lowercase. Where row and column coordinates are specified, they are 1-based. That is, row 1 column 1 is the first position on the screen. The following commands are valid:
Use to position the display point to the specified row and column coordinates. The syntax is:
AT row col
Use to move the display point a designated number of positions in any direction. An attempt to move off the screen in any direction results in an error condition. The syntax is:
commandname n
Use to move the insertion point to the beginning of the next line, unless the insertion point is already at the beginning of a line. NL may wrap the screen to position 1,1. The syntax is:
NL
Use to copy the data that follows to the screen. No validity checking is performed and the screen may wrap in any direction. The text string is delimited by any special character that is not part of the data itself. In operation, the first non-blank character following the DATA command is used as the delimiter. Data is transferred until the delimiter is encountered again. The remainder of the stack record, if any, is assumed to contain additional commands. The syntax is:
DATA /text/
The DATABEGIN command is similar to the DATA command, except that there are no delimiters. Instead, the text is assumed to begin with the first non-blank character following the blank-delimited command word and continues to the end of the stack record. The syntax is:
DATABEGIN text
Use to indicate that the next stack record is data to be written to the screen. Any remaining commands following DATARECORD in the same stack record are ignored. The syntax is:
DATARECORD
Use to repeat the specified single character n times. Screen wrapping is permitted. The values for char may be any single character, BLANK to repeat a blank, or NULL to repeat a null (binary zero) character. The syntax is:
REPEAT char n
Use to insert a 3270 attribute character with the specified characteristics. Note that each attribute requires one screen position. The arguments are delimited by any special character that does not appear in the arguments themselves. In operation, the first non-blank character following the ATTRIBUTE command is used as the delimiter. Arguments are processed until the delimiter is encountered again. The remainder of the stack record, if any, is assumed to contain additional commands. The syntax is:
ATTRIBUTE [MDT] [HIGH] [NODISP] [PROT] [NUM] [SKIP]
Use to position the cursor to the current display position. The syntax is:
CURSOR
The $3270() function produces these return codes:
101 - 103 ARG n MISSING OR INVALID
104 WCC not ALARM RESTORE RESET
121 INVALID AT ROW recnum data
122 INVALID AT COL recnum data
123 AT ROW TOO LARGE recnum data
124 AT COL TOO LARGE recnum data
125 FN ERROR n type xxxx recnum data
126 INVALID UP recnum data
127 UP OFF SCREEN recnum data
129 INVALID DOWN recnum data
130 DOWN OFF SCREEN recnum data
132 INVALID LEFT recnum data
133 LEFT OFF SCREEN recnum data
135 INVALID RIGHT recnum data
136 RIGHT OFF SCREEN recnum data
140 NO DATA AFTER DATARECORD recnum data
141 INVALID REPEAT CHAR recnum data
142 INVALID REPEAT COUNT recnum data
144 INVALID COMMAND: cmd recnum data
Example
queue 'at 1 1 attr /prot/ data /Enter ID =>/ attr /input high /' queue 'cursor right 8 attr /prot/' queue 'at 2 1 attr /prot/ data /Password =>/ attr /input nondisp/' queue 'right 8 attr /prot/' do i = 1 to canned_msg.0 queue 'nl datarecord' queue canned_msg.i end i screen = $3270(,,'erase','reset restore') if rc ^= 0 then signal error
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |