|
|
SNA IMF Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 Intrinsics Used with Standard MPE
I/OREADFIELD |
|
READFIELD reads a field of data from the internal screen image.
The READFIELD intrinsic returns the contents of a specified field in the internal screen image. You pass the terminal ID, a field number, an offset within the field, and the maximum number of characters to transfer. The READFIELD intrinsic returns the contents of the field (unless it is non-display) and the actual length of the data returned. If the specified field is non-display, the inbuf parameter is filled with a number of nulls equal to the value in the maxinbuflen parameter. By calling SCREENATTR before calling READFIELD, you can determine whether the screen is formatted, and if so, the number of fields in the screen. If the screen is unformatted (the SCREENATTR intrinsic has returned a numfields value of zero), you can read the screen by calling READFIELD with the fieldnum parameter set to zero. If you specify a maxinbuflen of more characters than a field actually contains, READFIELD will return a number of characters equal to the number of characters in the field. During printer emulation, you should routinely follow your last call to READFIELD (or to READSCREEN) with a call to RECV3270. The host cannot interrupt READFIELD with a data transmission during printer emulation, and you must call RECV3270 to indicate to the host that you are finished with the previous screen of data. If your device is configured as an LU.T3 printer on the host side, your internal screen image may contain printer orders embedded in the data. Examples of printer orders are CR (carriage return) and NL (New Line). IBM 3287 printer models differ, so consult the IBM 3270 Information Display System Data Stream Programmer's Reference (IBM part number GA23-0059) for further information about printer orders.
Use the READFIELD intrinsic in non-transparent mode. CALL "CREADFIELD" USING TERMINALID FIELDNUM OFFSET MAXINBUFLEN INBUF ACTINBUFLEN RESULT. (on MPE V and in compatibility mode on MPE XL) CALL INTRINSIC "READFIELD" USING TERMINALID FIELDNUM OFFSET MAXINBUFLEN INBUF ACTINBUFLEN RESULT. (in native mode on MPE XL) All parameters are numeric data items except INBUF, which is an alphanumeric data item. CALL READFIELD (TERMINALID, FIELDNUM, OFFSET, MAXINBUFLEN, INBUF, ACTINBUFLEN, RESULT) All parameters are integer variables except INBUF, which is a character array. CALL BREADFIELD (T, N, O1, L7, I$, L8, R) (on MPE V and in compatibility mode on MPE XL) CALL READFIELD (T, N, O1, L7, I$, L8, R) (in native mode on MPE XL) All parameters are integer variables except I$, which is a string variable.
READFIELD (TERMINALID, FIELDNUM, OFFSET, MAXINBUFLEN, INBUF, ACTINBUFLEN, RESULT) All parameters are integer variables except INBUF, which is a byte array. READFIELD (TERMINALID, FIELDNUM, OFFSET, MAXINBUFLEN, INBUF, ACTINBUFLEN, RESULT); All parameters are short integer variables except INBUF, which is a packed array of char. READFIELD (&TERMINALID, &FIELDNUM, &OFFSET, &MAXINBUFLEN, INBUF, &ACTINBUFLEN, &RESULT); All parameters are of type short, except INBUF, which is an array of characters (a pointer to a char). Following are excerpts from a Pascal program that calls SNA IMF intrinsics. For examples of complete Pascal programs in non-transparent and transparent modes, see Appendix F “Sample Programs”
|
|