Cfile=defin.rat ===== general character set definitions =============== C C file=vtdefin.rat defines for vtlib C C C vtcurs - subroutine to do relative cursor movements C SUBROUTINE VTCURS ( LINES, COLS ) C INTEGER LINES INTEGER COLS C negative for up or left; positive for down or right C if (.not.( LINES .ne. 0 )) goto 20000 do 20002 I = 1, IABS ( LINES ) CALL VTSEND ( 27 ) if (.not.( LINES .gt. 0 )) goto 20004 CALL VTSEND ( 66 ) goto 20005 20004 continue CALL VTSEND ( 65 ) 20005 continue 20002 continue 20003 continue 20000 continue if (.not.( COLS .ne. 0 )) goto 20006 do 20008 I = 1, IABS ( COLS ) CALL VTSEND ( 27 ) if (.not.( COLS .gt. 0 )) goto 20010 CALL VTSEND ( 67 ) goto 20011 20010 continue CALL VTSEND ( 68 ) 20011 continue 20008 continue 20009 continue 20006 continue CALL VTSEND ( 0 ) RETURN END C C vtdca - subroutine to do direct cursor addressing on vt52 C SUBROUTINE VTDCA ( LINE, COL ) C INTEGER LINE INTEGER COL C CALL VTSEND ( 27 ) CALL VTSEND ( 89 ) CALL VTSEND ( 31 + LINE ) CALL VTSEND ( 31 + COL ) CALL VTSEND ( 0 ) RETURN END C C vtfunc - subroutine to execute escape sequence functions on vt52 C SUBROUTINE VTFUNC ( FUNC ) C LOGICAL * 1 FUNC C C works for the following vt52 functions: C hold, nohold hold screen mode C altkp, noaltkp alternate keypad mode C erasel, erases erase from here to end of line, screen C home move cursor to upper lefthand cornor C graph, nograph graphics mode C up, down move cursor up or down 1 line C right, left move cursor right or left 1 column C C CALL VTSEND ( 27 ) CALL VTSEND ( FUNC ) CALL VTSEND ( 0 ) C RETURN END C C vtlabl - subroutine to write vertically on the vt52 C SUBROUTINE VTLABL ( OUTBUF ) C LOGICAL * 1 OUTBUF ( 1 ) C C cursor must first be moved to starting position on screen C I = 1 20012 if (.not.( OUTBUF ( I ) .ne. - 3)) goto 20014 CALL VTSEND ( OUTBUF ( I ) ) CALL VTCURS ( 1, - 1 ) 20013 I = I + 1 goto 20012 20014 continue RETURN END C C vtsend - subroutine to buffer and send characters to the vt52 C SUBROUTINE VTSEND ( CHAR ) C C file= cvtlib.rat for use with vtlib routines COMMON / CVTLIB / VTYPE, VTLUN INTEGER VTYPE INTEGER VTLUN LOGICAL * 1 CHAR, BUFR ( 40 ) DATA LAST / 0 / C if (.not.( CHAR .ne. 0 )) goto 20015 LAST = LAST + 1 BUFR ( LAST ) = CHAR 20015 continue if (.not.( LAST .ge. 40 .or. CHAR .eq. 0 )) goto 20017 WRITE ( VTLUN, 1 ) ( BUFR ( N ), N = 1, LAST ) 1 FORMAT ( $, 1h+, 40A1 ) LAST = 0 C 20017 continue RETURN END