[comp.os.vms] More on translating LTAnnnn: to Server/Port name

XRJJM%SCINT.SPAN@STAR.STANFORD.EDU (John McMahon, STX/COBE (x4333)) (06/02/88)

***> From: Jim Harvey - IJAH400@INDYVAX.BITNET
***> 

		(Thanks for the program Jim!)

***> PS: Here is the demo program (original was called LATREAD.FOR, do a TXT
***> search on DSIN for the product "TERMINAL/SERVER" and key "QIO INTERFACE
***> TO LAT"), as modified from the DSIN version (to take an arbitrary LAT
***> terminal name and to compile without errors):
***> 
***>       PROGRAM LATRAN
***>       
***>       INCLUDE '($IODEF)'

		(Lines Deleted)

***> C  Read port characteristics into P1 buffer.
***> 
***>       ISTAT = SYS$QIOW(,%VAL(LT_CHAN),
***>      +       %VAL(IO$_TTY_PORT.OR.IO$M_LT_READPORT),
***>      +       IOSB,,,%REF(READ_BUF),%VAL(READ_BUF_LEN),,,,)
***>       IF (.NOT. ISTAT) CALL LIB$STOP(%VAL(ISTAT))

Well, I inserted an "IMPLICIT NONE" in the program Jim posted and compiled it
under VMS 4.6/Fortran 4.6.  As it turns out, IO$M_LT_READPORT is not defined in
$IODEF for VMS 4.6/Fortran 4.6. 

However, if you know the value of IO$M_LT_READPORT you can hardcode the
value into the routine, and it will work.  IO$M_LT_READPORT = 256.
If you have 4.6, and you want to use the routine, change the QIO call
to:

C  Read port characteristics into P1 buffer.

      ISTAT = SYS$QIOW(,%VAL(LT_CHAN),
     +       %VAL(IO$_TTY_PORT.OR.256), 
     +       IOSB,,,%REF(READ_BUF),%VAL(READ_BUF_LEN),,,,)
      IF (.NOT. ISTAT) CALL LIB$STOP(%VAL(ISTAT))

And it works just fine.  I don't know about earlier versions of VMS or Fortran.

Note: If you run this program and give it the LAT terminal you are currently
using, it requires no privs.  If you want to use it on someone elses terminal,
you need SHARE. 

John McMahon
xrjjm%scint.span@star.stanford.edu