🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #29712

Absoft Fortran, dynamic arrays

#29712
From: Kevin Housen
Date: Thu, 30 Jun 1988 16:32
42 lines
1643 bytes
I am trying to dynamically allocate storage space for arrays
in Microsoft (Absoft) Fortran.  Basically, I have a main program
which calls a bunch of subroutines that do various operations
on arrays.  I thought it would be relativley simple to allocate
space for the arrays at run time - but it doesnt look so simple
now.  For example, here is some code that I thought would
allocate room for 100 real variables, and fill them with zeros.
Could someone please explain why this doesnt work?

       implicit none
       include :includes:memory.inc
       integer*4 toolbx, h

! allocate 400 bytes (for 100 reals)
       h=toolbx(NEWHANDLE, 400)
       call toolbx(HLOCK, h)

! fill the "array" with zeros.
       call zero(long(h), 100)

       pause
       end

       subroutine zero(a, n)
       implicit none
       real*4 a(n)
       do (i=1,n)
         a(i)=0.
       repeat
       end

When the program hits the pause statement, it produces an error 87
(file not open for read...), which is nonsense and leads me to believe
that Ive trashed something.  In other similar cases, the system dies.
Anyone know whats going on here??

Any help would be thrilling beyond the power of all descriptive
adjectives.

Thanks heaps,
Kevin Housen
Technical Details
Message-ID: <2054@ssc-vax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!fluke!ssc-vax!housen

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!fluke!ssc-vax!housen
From: housen@ssc-vax.UUCP (Kevin Housen)
Newsgroups: comp.sys.mac,comp.sys.mac.programmer
Subject: Absoft Fortran, dynamic arrays
Keywords: how?
Message-ID: <2054@ssc-vax.UUCP>
Date: 30 Jun 88 16:32:12 GMT
Organization: Boeing Aerospace Corp., Seattle WA
Lines: 42