[mod.computers.vax] How does

george@vax1.ccs.cornell.edu.UUCP (06/05/86)

I'm new to vms programming so forgive if this question has an obvious
answer. Simply point me to the documentation...

The vms help program uses the ? (question-mark) key in a special way.
Immediately after the ? key is pressed, help proceeds to display the
current help page, which usually has an index of help subtopics. Can
someone show me how a program could do that, set up certain keys to
cause interrupts (or whatever you call them in vms land)? Thanks.

On the side, I've always wondered why help couldn't read what was on
the input line before the ? instead of throwing it away... Or why couldn't
DCL do a similar thing ala TOPS-20... Just a thought.

George Boyce, Academic Computing, Cornell Computer Services
george@vax1.ccs.cornell.edu (128.84.252.10)
george@crnlcs.bitnet

"Olivier@ucbvax.UUCP (06/18/86)

> The vms help program uses the ? (question-mark) key in a special way.
> Immediately after the ? key is pressed, help proceeds to display the
> current help page, which usually has an index of help subtopics. Can
> someone show me how a program could do that, set up certain keys to
> cause interrupts (or whatever you call them in vms land)? Thanks.
 
> On the side, I've always wondered why help couldn't read what was on
> the input line before the ? instead of throwing it away... Or why couldn't
> DCL do a similar thing ala TOPS-20... Just a thought.

> George Boyce, Academic Computing, Cornell Computer Services
> george@vax1.ccs.cornell.edu (128.84.252.10)
> george@crnlcs.bitnet

Here is a Fortran subroutine (READ) using a QIO system service ala VMS-HELP
The second subroutine (ANALYZ) treats ascii character 63 (?); this shows how
HELP can ignore the string preceding "?".

Olivier Marchand - Etudes et Productions Schlumberger (France)
"OMARCHAND%EPSVXE@SLB-DOLL.CSNET"

	SUBROUTINE READ(LU,RDLTH,IOSB)
	IMPLICIT INTEGER (A-Z)
	INTEGER*2	CANAL
	INTEGER*2	FINI1(2)
	INTEGER	  	FINI(2)
	INTEGER		IOSB(2)
	BYTE		MASK(8)
	INTEGER*2	RDLTH
	INTEGER*2	PRLTH	/7/
	CHARACTER*512	LU
	CHARACTER*7	PROMPT	/'Topic? '/
	CHARACTER*11	TERMINAL	/'SYS$COMMAND'/
	EQUIVALENCE	(FINI,FINI1)
	INCLUDE		'($IODEF)'
c	-------------------------------------
	STATUS = SYS$ASSIGN(TERMINAL,CANAL,,)
c	-------------------------------------
	IF (.NOT. STATUS) STOP 'Error assigning a channel to SYS$COMMAND'

c we need 64 bits (=8 bytes) to be able to set bit number 63.
	FINI1(1) =  8
	FINI (2) = %LOC(MASK)
c			Zero mask
	DO I = 1, 8
	MASK(I) = 0
	ENDDO
c			set  bit  13 (ascii character 13 "<CR>" is a terminator)
	MASK(2) = 2**5
c			set  bit  63 (ascii character 63  "?"   is a terminator)
	MASK(8) = 2**7
c	-------------------------------------
	STATUS = SYS$QIOW(%VAL(5),
     &			%VAL(CANAL),
     &			%VAL(IO$_READPROMPT),
     &			IOSB,,,
     &			%REF(LU),
     &			%VAL(RDLTH),,
     &			%REF(FINI),
     &			%REF(PROMPT),
     &			%VAL(PRLTH))
c	-------------------------------------
	IF (.NOT. STATUS) STOP 'Error during read'
	RETURN
	END

	SUBROUTINE ANALYZ(STRING,LULTH,IOSB)
	CHARACTER*512	STRING
	INTEGER*2	IOSB(4)
	INTEGER*2	LULTH
	INTEGER*2	STATUS
	INTEGER*2	LENGTH
	INTEGER*2	TERMIN
	INTEGER*2	TRSIZE

	STATUS = IOSB(1)
	LENGTH = IOSB(2)
	TERMIN = IOSB(3)
	TRSIZE = IOSB(4)

	IF ((LENGTH.EQ.LULTH).AND.(TERMIN.EQ.0)) STOP 'String too long'
	IF (TERMIN.EQ.63) CALL DO
	RETURN
	END