housen@ssc-vax.UUCP (Kevin Housen) (06/30/88)
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