* Re: sys$brkthru questions
1993-09-09 19:03 sys$brkthru questions Chris Luchini
@ 1993-09-09 22:38 ` fairfield
0 siblings, 0 replies; 2+ messages in thread
From: fairfield @ 1993-09-09 22:38 UTC (permalink / raw)
In article <26numi$g3u@vixen.cso.uiuc.edu>, cbl@uihepa.hep.uiuc.edu (Chris Luchini) writes:
> I'm trying to write a piece of code that will tell me
> when I've recieved mail that's beed delivered by PMDF Deliver.
>
> I've tried to use sys$brkthru, but I can't get any
> effect other than 'bad parameter'.
>
> Will some kind soul either tell me what I'm doing
> wrong, or tell me which newsgroup would be the place
> to ask this question?
>
>
> IMPLICIT NONE
> INCLUDE '($FSCNDEF)'
> INCLUDE '($SSDEF)'
> INCLUDE '($RMSDEF)'
> INCLUDE '($LNMDEF)'
> include '($brkdef)'
> INTEGER RETVAL,STATUS,OUTLEN,CDIRLN,RET_LN
> INTEGER LIB$GET_FOREIGN,SYS$TRNLNM,SYS$DO_COMMAND,SYS$SETDDIR
> INTEGER SYS$CRELNM,SYS$FILESCAN,SYS$ASCTIM,SYS$GETTIM
> EXTERNAL SYS$ASCTIM,SYS$GETTIM
> INTEGER LIB$SIGNAL,lib$cvtf_from_internal_time,LIB$DAY,SYS$BINTIM
> external lib$cvtf_from_internal_time,LIB$DAY,SYS$BINTIM
> integer sys$brkthru
> external sys$brkthru
> integer i,j
> integer*4 iosb
> character msgbuf(3)*80,usr*4/'CBL '/,msg*80
> C
> RETVAL = LIB$GET_FOREIGN(msg,,OUTLEN)
> c do i=1,3
> c read(5,1,end=99) msgbuf(i)
> c enddo
> c99 i=i-1
> 1 format(1a80)
>
> c do j=1,i
> c SYS$BRKTHRU(efn ,msgbuf ,sendto ,sndtyp ,iosb,carcon ,flags ,reqid
> c ,timout ,astadr ,astprm)
> retval= SYS$BRKTHRU(,'this is a tst','fta82:',Brk$c_device,iosb,,,brk$c_user7,,,)
> WRITE(6,*) RETVAL
> retval= SYS$BRKTHRU(,'this is a tst','_fta82:',Brk$c_device,iosb,,,brk$c_user7,,,)
> WRITE(6,*) RETVAL
> retval= SYS$BRKTHRU(,'this is a tst','fta82',Brk$c_device,iosb,,,brk$c_user7,,,)
> write(6,*) retval
> c enddo
> end
You need to read the documentation on the arguments to $BRKTHRU more
closely, either via the Fine Manuals, BOOKREADER, or simply from DCL
with HELP SYSTEM $BRKTHRU.
First, the arguments "sndtyp" and "reqid" must be passed by value.
Secondly, you haven't supplied an event flag (so that event flag 0 is
used by default), so you'd better use $BRKTHRUW. Thirdly, while you
checked the return status of $BRKTHRU itself, you haven't checked the
completion status returned in the IOSB, nor have you declared it
properly, it is a _quadword_. There's also a good chance that the
device name, "sendto" argument, needs to be upper-cased: this isn't DCL
:-) The slightly modified code (sorry, I haven't tested it) would be:
.
.
INTEGER*2 IOSB(4)
.
.
RETVAL = SYS$BRKTHRUW (, 'this is a test', '_FTA82:',
> %VAL(BRK$C_DEVICE), IOSB,,
> %VAL(BRK$C_USER7),,,)
WRITE (6,*) 'RETVAL=',RETVAL
IF (RETVAL) WRITE (6,*) ' (Success)'
WRITE (6,*) 'IOSB(1)=', IOSB(1)
IF (IOSB(1)) WRITE (6,*) ' (Success)'
.
.
-Ken
--
Dr. Kenneth H. Fairfield | Internet: Fairfield@Slac.Stanford.Edu
SLAC, P.O.Box 4349, MS 98 | DECnet: 45537::FAIRFIELD (45537=SLACVX)
Stanford, CA 94309 | FAX: (415) 926-4335
----------------------------------------------------------------------------
These opinions are mine, not SLAC's, Stanford's, nor the DOE's...
^ permalink raw reply [flat|nested] 2+ messages in thread