Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!uvacs.UUCP!uucp From: uucp@uvacs.UUCP (UNIX-to-UNIX Copy) Newsgroups: comp.os.vms Subject: Submission for mod-computers-vax Message-ID: <8704250426.AA21380@uvacs.cs.virginia.edu> Date: Fri, 24-Apr-87 23:26:52 EDT Article-I.D.: uvacs.8704250426.AA21380 Posted: Fri Apr 24 23:26:52 1987 Date-Received: Sat, 2-May-87 07:39:43 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 60 Path: uvacs!virginia!umd5!brl-adm!seismo!rutgers!ucla-cs!ames!ucbcad!ucbvax!ge-crd.arpa!JOHNC%CAD2.DECnet From: JOHNC%CAD2.DECnet@ge-crd.arpa Newsgroups: mod.computers.vax Subject: IO$SENSEMODE w/ QIO Message-ID: <8704240128.AA28760@ucbvax.Berkeley.EDU> Date: 22 Apr 87 20:18:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 49 I am trying to determine from within a Fortran program whether or not the user has enabled echo, ie $SET TERM/ECHO. I assign a channel to the terminal and do an IO$SENSEMODE QIO. This returns 3 bytes of terminal characteristics, one bit of which should be set to 1 if the device is set /NOECHO. The mask TT$M_NOECHO has all but the correct bit (bit 2) set to 0. (ref p 8-21 and 8-45 IO User's Guide, pt 1) Here's the relevant part of the code: implicit none parameter p1size = 8 !size of qiow status buffer integer*4 IOSBL(2) INTEGER*2 CHANNEL,IOSB(4),P1BUF(4) INTEGER*4 SYS$QIOW,RETCODE,SYS$ASSIGN EQUIVALENCE (IOSB,IOSBL) include '($ttdef)' include '($ssdef)' include '($iodef)' . . . RETCODE = SYS$ASSIGN('TT',CHANNEL,,) (check return code for SS$_NORMAL) RETCODE = SYS$QIOW(,%VAL(CHANNEL),%VAL(IO$_SENSEMODE),IOSB,,, 1 %REF(P1BUF),%VAL(P1SIZE),,,,) (check return code for SS$_NORMAL) print '(1x,z8.8/1x,z8.8)', iosbl(1),iosbl(2) if ((iosbl(2) .and. tt$m_noecho) .eq. 0) then print *, 'echo is on' else print *, 'echo is off' endif . . . This code always returns the same values for IOSBL, regardless of whether the terminal has been set /echo or /noecho. What am I doing wrong? Any hints will be appreciated. ------------------------------------------------------------------------------ John Child "Hack, hack, hack. Don't you ever do anything General Electric but play with the computer?" Aircraft Engines - a loved one Lynn, MA