Pathway/iTS TCP and Terminal Programming Guide
Writing User Conversion Procedures
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide—426751-001
4-12
Intelligent Device Input Procedures
USERCODE
contains the numeric literal specified in the USER CONVERSION clause. The
procedure uses the supplied value of this parameter to determine which subset of
code to execute.
ERROR
contains 0 when the procedure is called. If an error indication is to be returned, the
procedure should set ERROR to a nonzero value. If ERROR is nonzero after the
call, the TCP reports an error.
INPUT
contains the string of characters input from the intelligent device. This string is the
raw data for the conversion.
INPUT^LEN
contains the length, in bytes, of the data item.
•
At the message level, the length is the number of characters received from the
intelligent device, that is, the I/O transfer count.
•
At the field level, length is relevant only if the item is alphabetic or alphanumeric.
Length is the effective length of the field; that is, either the declared length of the
field for fixed-format messages or the actual length of the field for delimited
(FIELD DELIMITERS ON) messages. Additionally, the TCP adjusts the length
(INPUT^LEN) by subtracting the number of trailing blanks found in a field. This
adjustment is performed for both fixed-format and delimited-format fields.
Figure 4-8. Device Alphanumeric Input Procedure Declaration
PROC USER^ALPHA^INPUT^MSG^CONV ( USERCODE, ERROR, INPUT,
INPUT^LEN, INTERNAL, INTERNAL^LEN, FILL^CHAR,
FILL^OFF, RIGHT^JUSTIFIED, FIELD^RETURNED,
FIELD^PRESENT );
INT USERCODE; ! Supplied by TCP
INT .ERROR; ! Generated by user procedure
STRING .EXT INPUT; ! Supplied by TCP
INT .INPUT^LEN; ! Supplied by TCP; modifiable by user
STRING .EXT INTERNAL; ! Generated by user procedure
INT INTERNAL^LEN; ! Supplied by TCP
STRING .FILL^CHAR; ! Supplied by TCP
INT FILL^OFF; ! Supplied by TCP
INT .FIELD^RETURNED; ! Generated by user procedure
INT .FIELD^PRESENT; ! Generated by user procedure