ŸŸŸ CRTLIB - Terminal control routines for the VT100 terminal Ÿ ŸCRTLIB is a collection of VT100 control routineŸŽs, which are ŸintendedŸŽ to simplify the construction of screen oriented ŸŸprograms. This library is an update of the lŸibrary ŸSCOPE.OLB most of theŸŽ routines have been extensivly modi- Ÿfied, wiŸŽth the parameter lists implemented in a slightly Ÿmore reasonable way. The major change to the lŸŽibrary is in Ÿthe I/O ŸŽsystem. CRTLIB now collects the output from the Ÿroutines into a large buffer which is transmitted as one big ŸQIO (ala RMD). An additional routine (FLUSH) will force out Ÿany text in the buffer. available routines: ŸŸ BEEP - causes audible alarm to sound Ÿ CENTER - centers desired text around a specified location Ÿ ERASE - clears the screen and optional selections Ÿ FLUSH - forces the remaining graphic commands from the buffer Ÿ FRAME - draws a box on the screen Ÿ GRAPH - places graphic characters on the screen Ÿ HIGH - writes to the screen in double high/wide mode Ÿ INDX - rolls the screen up Ÿ MODE - Sets terminal modes Ÿ PCURS - positions the cursor Ÿ RESCUR - restores the cursor position and attributes Ÿ RVINDX - rolls the screen down Ÿ SAVCUR - saves the cursor postion and attributes Ÿ SCROLL - specifies a scrolling region on the screen Ÿ SETATR - sets character attributes Ÿ SHOW - places the desired text on the screen Ÿ WIDE - writes to the screen in double width mode Ÿ Ÿ available input routines: Ÿ GETCHR - Returns a character, with waiting Ÿ INCHAR - Returns a character, without waiting Ÿ KILAST - Detaches the terminal Ÿ PARSE - Checks for function key input Ÿ SETAST - Attaches the terminal to the terminal routines Ÿ ŸŸŸ Lines are numbered 1 to 24. Ÿ Columns are numbered from 1 to 80, or 1 to 132 (w/avo). ŸŸŸ BEEP Ÿ FORTRAN Call: Ÿ CALL BEEP Ÿ Purpose: Ÿ Rings the bell on the terminal Ÿ Parameters: Ÿ none ŸŸŸ CENTER Ÿ FORTRAN Call: Ÿ CALL CENTER (icol,irow,len,itext) Ÿ Purpose: Ÿ Displays the text on the terminal centered on the Ÿ specified column. Ÿ Parameters: Ÿ PAGE 2 Ÿ icol - the column to center the text on Ÿ irow - the line the text will be displayed on Ÿ len - the length of the text Ÿ itext - the text to display ŸŸŸŸ Ÿ PAGE 3 ERASE Ÿ FORTRAN Call: Ÿ CALL ERASE [ (ifunc) ] Ÿ Purpose: Ÿ erase all or part of the screen Ÿ Parameters: Ÿ ifunc - optional erase function Ÿ values are: Ÿ no args - Erase entire screen Ÿ 0 - Erase from cursor to end of screen Ÿ 1 - Erase from beginning of screen to cursor Ÿ 2 - Erase entire screen (default) Ÿ 10 - Erase from cursor to end of line Ÿ 11 - Erase from beginning of line to cursor Ÿ 12 - Erase entire line ŸŸŸ FLUSH Ÿ FORTRAN Call: Ÿ CALL FLUSH Ÿ Purpose: Ÿ Force commands remaining in the buffer to the screen Ÿ Parameters: Ÿ none ŸŸŸ FRAME Ÿ FORTRAN Call: Ÿ CALL FRAME (icolul,irowul,icollr,irowlr) Ÿ Purpose: Ÿ Draws a box on the screen Ÿ Parameters: Ÿ icolul - column number for upper left hand corner Ÿ irowul - row number for upper left hand corner Ÿ icollr - column number for lower right hand corner Ÿ irowlr - row number for lower right hand corner Ÿ ŸŸŸ GRAPH Ÿ FORTRAN Call: Ÿ CALL GRAPH (icol,irow,ichar) Ÿ Purpose: Ÿ Places the specified character (from graphic character Ÿ set) at the specified coordinates Ÿ Parameters: Ÿ icol - the column to place the character into Ÿ irow - the row to place the character into Ÿ ichar - the ASCII code for the character (see VT100 ref. Ÿ card) ŸŸŸ HIGH Ÿ FORTRAN Call: Ÿ CALL HIGH (irow) Ÿ Purpose: Ÿ switches rows irow, and irow+1 to double high/wide mode Ÿ Parameters: Ÿ irow - the row number to switch ŸŸŸ INDX Ÿ FORTRAN Call: Ÿ PAGE 4 Ÿ CALL INDX Ÿ Purpose: Ÿ moves the cursor down on the screen, and if at the lower Ÿ edge, rolls the screen up Ÿ Parameters: Ÿ none ŸŸŸ FORTRAN Call: Ÿ CALL MODE (imode) Ÿ Purpose: Ÿ Sets terminal modes Ÿ Parameters: Ÿ imode - mode to set Ÿ Modes are: Ÿ 0 - 132 column mode Ÿ 1 - 80 column Ÿ 2 - Smooth scroll Ÿ 3 - Jump scroll Ÿ 4 - Reverse screen Ÿ 5 - Normal screen Ÿ 6 - Auto-repeat on Ÿ 7 - Auto-repeat off Ÿ.lit Ÿ PCURS Ÿ FORTRAN Call: Ÿ CALL PCURS [ (icol,irow) ] Ÿ Purpose: Ÿ positions the cursor at the specifed location Ÿ Parameters: Ÿ icol - column number to place cursor at (1 <= icol <= 132) Ÿ irow - row number to place cursor at (1 <= irow <= 24) Ÿ note: if the parameters are omitted, PCURS will Ÿ location (1,1) ŸŸŸ RESCUR Ÿ FORTRAN Call: Ÿ CALL RESCUR Ÿ Purpose: Ÿ restores the cursor position and attributes (see SAVCUR) Ÿ Parameters: Ÿ none Ÿ note: The SAVCUR, RESCUR functions are not recursive Ÿ (they Ÿ go down only one level) ŸŸŸ RVINDX Ÿ FORTRAN Call: Ÿ CALL RVINDX Ÿ Purpose: Ÿ moves the cursor up on the screen, and if at the upper Ÿ edge, rolls the screen down Ÿ Parameters: Ÿ none ŸŸŸ SAVCUR Ÿ FORTRAN Call: Ÿ CALL SAVCUR Ÿ PAGE 5 Ÿ Purpose: Ÿ restores the cursor position and attributes (see RESCUR) Ÿ Parameters: Ÿ none Ÿ note: The SAVCUR, RESCUR functions are not recursive Ÿ (they Ÿ go down only one level) ŸŸŸ SCROLL Ÿ FORTRAN Call: Ÿ CALL SCROLL [ (itop,ibot) ] Ÿ Purpose: Ÿ defines a scrolling region on the screen Ÿ Parameters: Ÿ itop - top row of region Ÿ ibot - bottom row of region Ÿ note: if parameters are omitted the region will be reset Ÿ to the entire screen ŸŸŸ SETATR Ÿ FORTRAN Call: Ÿ CALL SETATR [ (iatrib) ] Ÿ Purpose: Ÿ sets cursor attributes Ÿ Parameters: Ÿ iatrib - the cursor attribute Ÿ the possible attributes are: Ÿ no parameters - all attributes off Ÿ 0 - all attributes off Ÿ 1 - bold on Ÿ 4 - underscore Ÿ 5 - blink Ÿ 7 - reverse video ŸŸŸŸ Ÿ PAGE 6 SHOW Ÿ FORTRAN Call: Ÿ CALL SHOW (icol,irow,len,itext) Ÿ Purpose: Ÿ Displays the text on the terminal Ÿ Parameters: Ÿ icol - the column to display the text on Ÿ irow - the line the text will be displayed on Ÿ len - the length of the text Ÿ itext - the text to display ŸŸŸ WIDE Ÿ FORTRAN Call: Ÿ CALL WIDE (irow) Ÿ Purpose: Ÿ sets the specified line to wide mode Ÿ Parameters: Ÿ irow - the row number to change ŸŸŸ also available are: Ÿ SELUK - select UK character set Ÿ SELUSA - select USA (ASCII) character set Ÿ SELGRA - select graphic character set Ÿ SCR132 - place the terminal into 132 column mode Ÿ SCR80 - place the terminal into 80 column mode Ÿ APPLIC - place cursor keys and keypad into application mode Ÿ NUMRIC - place cursor keys and keypad into normal mode Ÿ Ÿ All of these routines are called by: Ÿ Ÿ CALL Ÿ Ÿ There are no parameters. ŸŸŸ Ÿ PAGE 7 Keyboard Input Routines ŸŸ PARSE Ÿ FORTRAN call: Ÿ ival = PARSE() Ÿ Purpose: Ÿ Parses the terminal input to determine if a function key Ÿ was pressed. The routine returns either the character Ÿ pressed, the Ÿ code for the function key pressed, or an error code Ÿ Parameters: Ÿ none Ÿ ŸŸ FUNCTION CODES ŸŸ Decimal Octal Key Decimal Octal Key Ÿ ------- ------- ------------ ------- ------- Ÿ ------------ Ÿ (129) 201 = arrow up (141) 215 = key 0 Ÿ (130) 202 = arrow down (142) 216 = key 1 Ÿ (131) 203 = arrow right (143) 217 = key 2 Ÿ (132) 204 = arrow left (144) 220 = key 3 Ÿ (133) 205 = ENTER (145) 221 = key 4 Ÿ (134) 206 = PF1 (146) 222 = key 5 Ÿ (135) 207 = PF2 (147) 223 = key 6 Ÿ (136) 210 = PF3 (148) 224 = key 7 Ÿ (137) 211 = PF4 (149) 225 = key 8 Ÿ (138) 212 = key , (comma) (150) 226 = key 9 Ÿ (139) 213 = key - (minus) (255) 377 = Error Ÿ code Ÿ (140) 214 = key . (period) Ÿ Ÿ Note: The function PARSE must be declared as an integer (in Ÿ fortran Ÿ use "INTEGER PARSE") Ÿ ŸŸŸ SETAST Ÿ FORTRAN call: Ÿ CALL SETAST Ÿ Purpose: Ÿ Connects the terminal to the AST routines Ÿ Parameters: Ÿ none ŸŸŸ KILAST Ÿ FORTRAN call: Ÿ CALL KILAST Ÿ Purpose: Ÿ Disconnects the terminal from the AST routines Ÿ Parameters: Ÿ none ŸŸŸ INCHAR Ÿ FORTRAN call: Ÿ CALL INCHAR ( ichar ) Ÿ Purpose: Ÿ Returns a character from the buffer Ÿ PAGE 8 Ÿ Note: the routine returns the value -1 if the buffer is Ÿ empty Ÿ Parameters: Ÿ Ichar - the variable in which to place the character Ÿ ŸŸŸŸ Ÿ PAGE 9 GETCHR Ÿ FORTRAN call: Ÿ ival = GETCHR() Ÿ Purpose: Ÿ The routine returns a character from the buffer, if the Ÿ buffer is empty, the routine will wait for a character Ÿ to be Ÿ entered. Ÿ Parameters: Ÿ none ŸŸŸ STATUS Ÿ FORTRAN call: Ÿ call STATUS ( istate ) Ÿ Purpose: Ÿ The routine clears out the input buffer and requests that Ÿ the terminal identify its configuration. Ÿ The Identification codes are: Ÿ 0 - Base VT100, no options Ÿ 1 - Processor option (STP) Ÿ 2 - Advanced Video option (AVO) Ÿ 3 - AVO and STP Ÿ 4 - Graphics processor option (GPO) Ÿ 5 - GPO and STP Ÿ 6 - GPO and AVO Ÿ 7 - GPO, STP and AVO ŸŸ Ÿ