Sending an array to DLL Function

D

Domagoj Vulin

I have adapted one old Fortran application to DLL and made input interface
in Excel. I have to send array of variables to that DLL and get back array
of results.
Here's a part:

'FORTRAN SUBROUTINE ZFAK(TITLE, NT, TT, IA, X1, P1, P2, DELP, MP, X2, PP,
P, RP, Z, Z1,WMA, DENS, GRAV, PPCAT, PPC, TPCC, TPC, RT, M1)

and in VBA macro
Call ZFAK("naslov", NT, TT, IA, X1, P1, P2, DELP, MP, X2, pp, P, RP, z, z1,
WMA, DENS, GRAV, PPCAT, PPC, TPCC, TPC, RT, M1)

input variables: "naslov", NT, TT, IA, X1, P1, P2, DELP, MP
output variables X2, pp, P, RP, z, z1, WMA, DENS, GRAV, PPCAT, PPC, TPCC,
TPC, RT, M1
X1 and X2 are arrays [x1(12), x2(12)]

Thanks
 
D

Domagoj Vulin

As an alternate approach, if may be quite simple to dump the FORTRAN code
into VBA. It'll be slower but it'll solve the array passing problem.
That's the thing I've been thinking about so many times, but there are lot
of other FOR subroutines to work with, so this solution is unacceptable :).
 
Top