VBLOCKREAD [ Migration Process Guide ] MPE/iX 5.0 Documentation
Migration Process Guide
VBLOCKREAD
The VBLOCKREAD intrinsic reads a block of characters from a terminal in
block mode. The syntax and parameter descriptions for this intrinsic are
provided below.
VBLOCKREAD {COMAREA,BUF,LEN,ACTLEN,TMODE,LOC,BC,TC}
COMAREA The following COMAREA fields must be set before
calling VBLOCKREAD, if not already set:
LANGUAGE Set to code identifying the
programming language of the
calling program.
COMAREALEN Set to total number of 2-byte
words in COMAREA.
VBLOCKWRITE may set the following COMAREA fields:
CSTATUS Set to nonzero value if call
is unsuccessful.
FILERRNUM Set to file error code if MPE
file error.
BUF Byte array to receive data from the terminal.
LEN Maximum number of bytes to read from terminal
(2-byte integer).
ACTLEN Actual number of bytes read from terminal (2-byte
integer).
TMODE Terminal setting at the time of read (2-byte
integer).
1 assume terminal is in format
mode
2 assume terminal is in
unformatted mode
LOC Array of two 2-byte integers containing start
position of read.
[0] [0] home cursor before read
[-1] [0] start from current cursor
position
BC Buffer control (2-byte integer)--not currently
used. Must initialize to zero.
TC Terminal control (2-byte integer)--not currently
used. Must initialize to zero.
This intrinsic reads a block of data from the terminal with a number of
options. There are two major differences between VREADFIELDS and this
procedure. First, it provides more options for reading data from the
terminal. Second, data read is returned directly to the application
buffer. There is no VPLUS form associated with the read.
Like the companion intrinsic, VBLOCKWRITE, this procedure is recommended
only for advanced programmers who are proficient with terminal
input/output. VOPENTERM must be called before using VBLOCKREAD. The
keyboard must be unlocked before calling VBLOCKREAD. (Refer to keyboard
unlock options in VBLOCKWRITE.) VBLOCKREAD will lock the keyboard
immediately after Enter or a function key is pressed to ensure data
integrity.
This procedure is primarily designed for unformatted reads. For users
who do not use VREADFIELDS but use VBLOCKREAD to read data in format
mode, the application data interpretation algorithm should accommodate
both MDT (Modified Data Tag) and non-MDT inputs. When MDT is on,
unmodified blanks and data are not transmitted from the terminal. Refer
to the appropriate terminal reference manuals for further explanation of
the MDT feature.
The following examples illustrate a call to VBLOCKREAD using common
programming languages:
COBOL:
CALL "VBLOCKREAD" USING COMAREA @BUF LEN ACTLEN
TMODE LOC BC TC.
BASIC:
CALL VBLOCKREAD(C(*),B1$,L1,L2,M1,L(*),U1,U2)
FORTRAN:
CALL VBLOCKREAD(COMAREA,BUF,LEN,ACTLEN,TMODE,LOC,BC,TC)
SPL:
VBLOCKREAD(COMAREA,BUF,LEN,ACTLEN,TMODE,LOC,BC,TC);
Pascal:
VBLOCKREAD(COMAREA,BUF,LEN,ACTLEN,TMODE,LOC,BC,TC);
MPE/iX 5.0 Documentation