Previous Topic: Notation ConventionsNext Topic: $ALIAS()


$3270()

This function converts English commands and data into a 3270-compatible data stream. Information is passed to the function as arguments and on the current stack.

Syntax

stream = $3270([rows],[cols],[{WRITE|ERASE|NONE}],[{ALARM|RESET|RESTORE}])

Parameters

stream

3270 data stream. A command byte and a Write Control Character (WCC) preface this data stream

rows

Number of rows on the screen. The Logon Facility determines the default value.

cols

Number of columns on the screen. The Logon Facility determines the default value.

WRITE

Indicates that the finished data stream is intended to be written without first erasing the display. The new data overlays and selectively replaces the existing data.

ERASE

Indicates that the finished data stream is intended to replace completely any existing display.

NONE

Indicates that the finished data stream does not contain a command or WCC. The returned data can 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 can appear in combination with RESTORE and RESET, separated by blanks.

RESTORE

Sets the Restore keyboard flag in the WCC. This can appear in combination with ALARM and RESET, separated by blanks.

RESET

Sets the Reset modified data tag flag in the WCC. This can appear in combination with RESTORE and ALARM, separated by blanks.

Commands

Commands are passed to $3270() using the current stack. Each command and its accompanying arguments must be complete in one stack record. Multiple commands can appear in a single stack record. Except where otherwise specified, blanks separate commands and arguments. Commands can 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:

AT

Use to position the display point to the specified row and column coordinates. The syntax is:

AT row col
UP | DOWN | LEFT | RIGHT

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
NL

Use to move the insertion point to the beginning of the next line, unless the insertion point is at the beginning of a line. NL can wrap the screen to position 1,1. The syntax is:

NL
DATA

Use to copy the data that follows to the screen. No validity checking is performed and the screen can 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 more commands. The syntax is:

DATA /text/
DATABEGIN

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
DATARECORD

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
REPEAT

Use to repeat the specified single character n times. Screen wrapping is permitted. The values for char can be any single character, BLANK to repeat a blank, or NULL to repeat a null (binary zero) character. The syntax is:

REPEAT char n
ATTRIBUTE

Use to insert a 3270 attribute character with the specified characteristics. 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 more commands. The syntax is:

ATTRIBUTE [MDT] [HIGH] [NODISP] [PROT] [NUM] [SKIP]
CURSOR

Use to position the cursor to the current display position. The syntax is:

CURSOR

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