[mod.computers.vax] SYS$SETIMR non-problem

nagy%bsndbg.hepnet@LBL.ARPA (03/17/87)

Alco Blom writes:

>I want to execute a routine every 3 seconds. I thought to
>do that with SYS$SETIMR. However I have problems with it.
>...     
>*--------
>subroutine astproc
>implicit none
>     
>include '($syssrvnam)'
>include 'sys$library:uisentry'
>include 'sys$library:uisusrdef'
>     
>integer status
>     
>logical done
>integer bindelay(2)
>common /uva/ done,bindelay
>     
>call uis$sound_bell('sys$workstation',4)
>     
>C now reset timer
>status = SYS$SETIMR(,bindelay,astproc,)
>if (.not. status) call lib$stop(%VAL(status))
>     
>return
>end
>     
>*--------
>The compiler gives the following messages
>     
>FORT-F-INVLEXEME, Variable name, constant or expression invalid in
>this context.
>[lay,astproc, )] in module astproc
     
The problem is with your second SYS$SETIMR call where you are passing
the parameter "astproc" from INSIDE the astproc routine!  This is a
no-no in FORTRAN as evidenced from the compiler error message.  The
thing to do is to embed the SYS$SETIMR call in a 3rd routine which
is called from astproc as in:

*-------
subroutine astproc
implicit none
     
include 'sys$library:uisentry'
include 'sys$library:uisusrdef'
     
call uis$sound_bell('sys$workstation',4)
     
C now reset timer
call astsetimr
     
return
end
     
*--------
subroutine astsetimr
implicit none
     
include '($syssrvnam)'
     
integer status
     
logical done
integer bindelay(2)
common /uva/ done,bindelay

external astproc
     
C now reset timer
status = SYS$SETIMR(,bindelay,astproc,)
if (.not. status) call lib$stop(%VAL(status))
     
return
end
     
*--------
This is FORTRAN problem, not a VMS system service problem.