QIOWGET: PROC(CHARS_NEEDED) RETURNS(CHAR(*) VARYING); /* SUBROUTINE USES QIOW SYSTEM SERVICE TO GET A STRING FROM TERMINAL VALUE PASSED IS LENGTH OF STRING REQUESTED. AUTHOR: AL JAWORSKI DATE: MARCH 12, 1982 */ %INCLUDE $STSDEF; %INCLUDE TESTCHAN; %INCLUDE SYS$QIOW; %INCLUDE QIOWPUT; %INCLUDE UPPER; DCL CHARS_NEEDED FIXED BINARY(31); DCL (P,Q) POINTER; DCL BUFFER CHAR(CHARS_NEEDED) BASED(P); DCL STRING CHAR(CHARS_NEEDED) VARYING BASED(Q); DCL TTCHAN FIXED BINARY(15) GLOBALREF; DCL (IO$_READLBLK,IO$M_TRMNOECHO) FIXED BINARY(31) GLOBALREF VALUE; DCL 1 IOSB, 2 VALUE FIXED(15), 2 BYTES_RECEIVED FIXED(15), 2 NOT_USED FIXED(31); DCL IO_SUCCESS BIT(1) ALIGNED BASED(ADDR(IOSB)); CALL TESTCHAN; ALLOC STRING SET(Q); ALLOC BUFFER SET(P); STS$VALUE=SYS$QIOW(,TTCHAN,IO$_READLBLK+IO$M_TRMNOECHO ,IOSB,,,P,CHARS_NEEDED,,,,); IF STS$SUCCESS THEN DO; STRING=SUBSTR(BUFFER,1,BYTES_RECEIVED); STRING=UPPER(STRING); END; ELSE DO; CALL QIOWPUT('Error in QIOW read'); STRING=''; END; FREE BUFFER; RETURN(STRING); END QIOWGET;