🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: mod.computers.vax
Article #3791

Fortran compiler feature

#3791
From: SYSMGR%UK.AC.KCL.PH.IPG
Date: Tue, 17 Mar 1987 09:22
52 lines
2680 bytes
From:    info-vax-request@uk.ac.ucl.cs 16-MAR-1987 20:50
To:    SYSMGR
Subj:    SYS$SETIMR


Received: from CS.UCL.AC.UK by mv1.Cs.Ucl.AC.UK   via List-Channel  id aa10227;
          16 Mar 87 18:18 WET
Received: from ucl-cs-vax1 by mv1.Cs.Ucl.AC.UK   via Ethernet with SMTP
           id aa10221; 16 Mar 87 18:17 WET
Received: from 44d.cs.ucl.ac.uk by vax1.Cs.Ucl.AC.UK   with SMTP  id aa04257;
          16 Mar 87 18:15 GMT
Received: from [10.1.0.2] by 44d.Cs.Ucl.AC.UK   via Satnet with SMTP  id a016535
          16 Mar 87 18:14 GMT
Received: from wiscvm.wisc.edu by SRI-KL.ARPA with TCP; Mon 16 Mar 87 06:55:35-P
Received: from HASARA5.BITNET by wiscvm.wisc.edu on 03/16/87 at 08:56:24 CST
Date: 16 MAR 87 15:54-N
From: U00159 <U00159%bitnet.hasara5@edu.wisc.wiscvm>
To: INFO-VAX@arpa.sri-kl
Subject: SYS$SETIMR
Sender: info-vax-request@uk.ac.ucl.cs


> I want to execute a routine every 3 seconds. I thought to
> do that with SYS$SETIMR. However I have problems with it. (...)
> The program here does not compile.
..
> subroutine astproc
..
..
> status = SYS$SETIMR(,bindelay,astproc,)
> if (.not. status) call lib$stop(%VAL(status))
..
> The compiler gives the following messages
> FORT-F-INVLEXEME, Variable name, constant or expression invalid in
> this context.
> [lay,astproc, )] in module astproc

It's a feature of the compiler (or a bug). You cannot refer to a subroutine or
function's name from within itself, presumably because FORTRAN does not allow
recursion and DEC have not realised that the above example does not actually
involve recursion.

If you put EXTERNAL ASTPROC and the SYS$SETIMR call into another subroutine,
and call that from ASTPROC itself, you will successfully fool the compiler
and everything will work perfectly.

My memory may be at fault, but I think it used to work on the old compiler...

Nigel Arnot (Dept. Physics, Kings college, Univ. of London;  U.K)

Bitnet/NetNorth/Earn:   sysmgr@ipg.ph.kcl.ac.uk (or) sysmgr%kcl.ph.vaxa@ac.uk
       Arpa         :   sysmgr%ipg.ph.kcl.ac.uk@ucl-cs.arpa
Technical Details
Message-ID: <8703170921.AA09168@ucbvax.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!rutgers!ames!ucbcad!ucbvax!AC.UK!SYSMGR%UK.AC.KCL.PH.IPG

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!rutgers!ames!ucbcad!ucbvax!AC.UK!SYSMGR%UK.AC.KCL.PH.IPG
From: SYSMGR%UK.AC.KCL.PH.IPG@AC.UK
Newsgroups: mod.computers.vax
Subject: Fortran compiler feature
Message-ID: <8703170921.AA09168@ucbvax.Berkeley.EDU>
Date: Tue, 17-Mar-87 04:22:22 EST
Article-I.D.: ucbvax.8703170921.AA09168
Posted: Tue Mar 17 04:22:22 1987
Date-Received: Wed, 18-Mar-87 06:07:17 EST
Sender: daemon@ucbvax.BERKELEY.EDU
Distribution: world
Organization: The ARPA Internet
Lines: 52
Approved: info-vax@sri-kl.arpa