.lo 3,2 .lm 0.rm 72 .fl bold.fl break.fl capitalize.fl hyphenate.fl index.xl.fl period .nhd .fgd 15 .c;^*TERMINALIO and TERMINALQIO\* .b 5 .c;^*^&VAX/VMS Terminal\&\* .c;^*^&Input/Output Routines\&\* .b 10 .c;by .b .c;^&Rodrick A. Eldridge\& .c;^&Iowa State University\& .pg .c;^*Overview\* .b 2 This paper presents two modules containing routines which implement, in the MLR Macro Language, terminal I/O routines using RMS and QIO. These routines perform single character and line oriented terminal I/O on VAX/VMS. .b .nt ^*Notice\* .b 2 In order to reassemble any of these routines, you must have the MLR Macro Language. The MLR Macro Language is a set of macros which implement structured programming in VAX-11 Macro. .en .pg .c;^*RMS Terminal I/O Routines\* .b 3 ^&TerminalIo\& .b This routine initializes the RMS I/O routines. This routine is optional, and if not called explicitly, the other RMS Terminal I/O routines will call this routine implicitly. .b The TerminalIo routine requires no parameters. .b 3 ^&Read\& .b This routine returns a single character from the input device, i.e. SYS$INPUT. An entire line is read implicitly and kept internally. Each subsequent call to Read, returns the next single character in turn from this input buffer. If the last character of a line has been returned, the next Read will cause another line to be read and the above sequence is repeated. An end-of-file condition indicates that there are no more characters to return. .b The Read routine requires one parameter: .ls "o" .le;An address of a byte that will contain the returned character. .els .b 3 ^&ReadString\& .b This routine returns an entire line from the input device, i.e. SYS$INPUT. An entire line is read and each subsequent call to ReadString causes another line to be read. Any characters remaining in the internal input buffer will be lost. An end-of-file condition indicates that there are no more lines to be read. .b The ReadString routine requires one parameter: .ls "o" .le;An address of a string descriptor that will contain the returned string. .els .b 3 ^&ReadAgain\& .b This routine resets the internal input position pointer of the current line being read to allow subsequent calls to Read to return characters from the start of input line. .b The ReadAgain routine requires no paraemeters. .b 3 ^&ReadLn\& .b This routine causes the remainder of the current input line to be ignored and causes the next input line from the input device, i.e. SYS$INPUT, to be read. Subsequent calls to Read will return characters from the start of this new input line. .b The ReadLn routine requires no parameters. .b 3 ^&Write\& .b This routine writes a single character to the output device, i.e. SYS$OUTPUT. These characters are placed in an internal output buffer and each subsequent call to Write will append each character to this buffer. To flush the buffer, issue a call to either the WriteLn or WriteString routines. .b The Write routine requires one parameter: .ls "o" .le;An address of a byte that contains the character to be written. .els .b 3 ^&WriteString\& .b This routine writes a line to the output device, i.e. SYS$OUTPUT. Any characters in the internal output buffer are written first. A carriage return and line feed is written prior to writting the output line. .b The WriteString routine requires one parameter: .ls "o" .le;An address of a string descriptor containing the string to be written. .els .b 3 ^&WriteLn\& .b This routine flushes the internal output buffer. A carriage return and line feed is written prior to writting the output buffer. .b The WriteLn routine requires no parameters. .pg .c;^*QIO Terminal I/O Routines\* .b 3 ^&TerminalQio\& .b This routine initializes the QIO I/O routines. This routine is optional, and if not called explicitly, the other QIO Terminal I/O routines will call this routine implicitly. .b The TerminalQio routine requires no parameters. .b 3 ^&Get\& .b This routine returns a single character from the input device, i.e. SYS$INPUT. An end-of-file condition indicates that there are no more characters to return. .b The Get routine requires three parameters: .ls "o" .le;An address of a word that will contain the QIO function modifiers. If no QIO function modifiers are required, specify either 0 as the value or pass 0 as the address. .le;An address of a string descriptor that contains the prompt string to be written prior to getting the character. If no prompt is required, pass 0 as the address. .le;An address of a byte that will contain the character to be returned. .els .b 3 ^&GetString\& .b This routine returns an entire line from the input device, i.e. SYS$INPUT. An entire line is read and each subsequent call to GetString causes another line to be read. An end-of-file condition indicates that there are no more lines to be read. .b The GetString routine requires three parameters: .ls "o" .le;An address of a word containing the QIO function modifier. If no QIO function modifier is required, specify 0 as the value or pass 0 as the address. .le;An address of a string descriptor that will contain the prompt string to be written prior to getting the input string. If no prompt is required, pass 0 as the address. .le;An address of a string descriptor that will contain the returned string. .els .b 3 ^&Put\& .b This routine writes a single character to the output device, i.e. SYS$OUTPUT. .b The Put routine requires two parameters: .ls "o" .le;An address of a word that contains the QIO function modifier. If no QIO function modifier is equired, specify 0 as the value or pass 0 as the address. .le;An address of a byte that contains the character to be written. .els .b 3 ^&PutString\& .b This routine writes a line to the output device, i.e. SYS$OUTPUT. A carriage return and line feed is written prior to writting the output line. .b The PutString routine requires two parameters: .ls "o" .le;An address of a word that contains the QIO function modifier. If no QIO function modifier is required, specify 0 as the value or pass 0 as the address. .le;An address of a string descriptor containing the string to be written. .els .b 3 ^&PutLn\& .b This routine writes a carriage return and line feed to the output device, i.e. SYS$OUTPUT. .b The PutLn routine requires no parameters.