Language Reference - Appendix 

Input/Output and Control Options

 

Several directives and system functions include optional syntax elements in their formats. Some are defined individually, and some are listed in format groups (ctrlopt or fileopt).

File Options (fileopt) are used to fine tune code and redirect processing; e.g. they can be used to handle exceptions, set the position of the key, deal with data errors, etc.

Control Options (ctrlopt) are used primarily to set various aspects of a control object.

Refer to the format (syntax) descriptions of the specific directive and function for information on the use of each option listed below.

File Options

Common input/output file options are listed below.

BSY=stmtref

On record or file busy status, transfer to program line number/statement label.

BSZ=num

Block size in bytes.

DIR=num

Direction indicator. This adjusts the record pointer by num records where a positive value advances the pointer, a negative pointer reverses the pointer, and a DIR=0 indicates no movement. This option is not supported with use of the [WDX] tag.

DOM=stmtref

When specified, the DOM option indicates the statement number (nnnn) to transfer to if the record referenced by the directive is either missing (in the case of READ directives) or already exists (in the case of WRITE directives).

END=stmtref

When specified on a READ directive, the END option indicates the statement number (nnnn) to transfer to if the end of the file is reached (Error #2).

On a WRITE directive, the END option causes a transfer if the output file has reached its maximum size or no more file space is available.

ERR=stmtref

The ERR option specifies the statement to transfer to should any error occur during the processing of the directive.

If used in conjunction with the BSY=, DOM= or END= options, the other options take precedence.

IND=num

Generally used to define the record being accessed by its record 32-bit record index.

For Fixed Length Keyed files, num represents an offset into the data file (first record has an index of 0, second is 1, and so on). However, some record indexes will be set aside by the system to be used for key tables and may yield gaps where the record indexes have been used for keys.

For Variable Length Keyed files, num represents a logical page address and record index within that page. The page address is contained in the top 24-bits (high order 3 bytes) with a record index within that page in the lower 8 bits. For VLR files, the page address is the actual physical address for the data page. For EFF files, the page address is a logical page number in the file.

For TCP/IP Server files, num represents an internal socket connection to the client that can be used to manually direct output to specific sockets.

Used with the INPUT directive, IND=num sets the starting position (column number) of the cursor in the input field.

IOL=iolref

Either a string variable containing the object code of an IOLIST, the name of the IOLIST (for files with multiple record formats) or a statement reference to an IOList (statement number/label).

ISZ=num

File open for access in binary mode.

KEY=string$

Record key or Password to open file. (KEY\="?" provides list of databases (tables) defined in PxPlus ODBC.)

KNO=num|name$

File access key number (num) or name (name$), where num is 0 based (0 - 15 for VLR/FLR files; 0 - 255 for EFF files).

Note:
Using the SELECT directive with the KNO= option to access records by a logical position is not supported on FLR files because the key blocks are randomly intermingled with the data and deleted records are not distinguishable from live data.

LEN=num

The LEN option can be used with the INPUT directive to limit the length of the input data. If this option is specified the INPUT directive, only the number of characters specified by num will be read. No further data will be accepted. The input must be terminated by a <ENTER> key, control key, or other function key.

NBF=num

Dedicated number of buffers.

NUL=stmtref

On no input, transfer to program line number/statement label.

OPT=string$

File open options.

REC=string$

Record prefix (REC=VIS(string$) can also be used).

RNO=num

Record number.

RTY=num

Number of times to retry (one second intervals). Default is set via the 'WT'= system parameter.

SEP=char$

Default field separator character. Hex or ASCII string value.

SIZ=num

Number of Characters to Read: If negative, num identifies the number of characters to be read. If num is a positive number, the read continues until num characters are received.

Number of Bytes to Write: If num exceeds the amount of data being written from the variable, the data is padded with nulls.

TBL=stmtref

Data translation table.

TIM=num

Maximum time delay to wait before returning a Record/File Busy error.

Control Options

The following options are used in control directives:

ERR=stmtref

Error transfer.

FNT="font,size[,attr]"

Font name, size, optional attributes. See 'FONT' mnemonic.

FMT=def$|mask$

Format definition for the associated control. For character string masks, see Data Format Masks.

KEY=char$

Hot key.

LEN=num

Maximum input characters.

MSG=text$

Message line.

MNU=ctl

CTL value associated with right-click menu event.

NUL=string$

Empty value.

OPT=char$

Single character parameter/option.

SEP=char$

Single character translation.

TIP=text$

Mouse pointer message. See 'TC'= system parameter to change the colour.