Re: PASSING ARRAY FORTRAN DLL TO/FROM VBA EXCEL



Thanks so much. I will try it.

Irfan


On Sep 22, 9:25 am, dpb <n...@xxxxxxx> wrote:
kis wrote:
Can you pls give me an example code that does this?
FYI, I use CVF 6.6

...
There is a section on arrays in mixed-language programming in the CVF
documentation in the mixed language programming section as well as
sample projects for each data type (strings, variables, arrays, UDTs, ...)

One small section contains the following snippet; reading the section
will enlighten greatly...

Handling Arrays and Visual Fortran Array Descriptors
...
To pass an array from Visual Basic to Fortran, pass the first element of
the array. By default, Visual Basic passes variables by reference, so
passing the first element of the array will give Fortran the starting
location of the array, just as Fortran expects. ...

  ' In Basic
  Declare Sub FORTARRAY Lib "fortarr.dll" (Barray as Single)
  DIM barray (1 to 3, 1 to 7) As Single
  Call FORTARRAY(barray (1,1))

  ! In Fortran
  Subroutine FORTARRAY(arr)
     REAL arr(3,7)

--

.



Relevant Pages

  • Re: Who uses clapack?
    ... > functions like SUM and MAXVAL and the ability to use array sections ... > drastically change the meaning of a Fortran code. ... >>Have you ever seen those bills for a Fortran compiler for an ... engineering applications in the C and C++ languages. ...
    (sci.math.num-analysis)
  • Re: Who uses clapack?
    ... > functions like SUM and MAXVAL and the ability to use array sections ... > drastically change the meaning of a Fortran code. ... >>Have you ever seen those bills for a Fortran compiler for an ... engineering applications in the C and C++ languages. ...
    (comp.lang.fortran)
  • Re: Benchmarking APL
    ... with that of FORTRAN. ... APL a 400% gain in programming efficiency could be obtained with only ... Another good-for-APL array problem, vector convolution, gave these ... Tomcatv, one of the SPEC benchmarks, is more typical of large array ...
    (comp.lang.apl)
  • Re: Attempting to allocate already allocated array?
    ... and I've written a good enough Python wrapper. ... If the python array is C contiguous (numpy arrays can be either Fortran or C contiguous under the hood, without you knowing it) you risk copying these arrays on entry to SUDA, just to get them on Fortran form. ... To do that I need to compare the SUDA (Special Uniques Detection Algorithm) approach, of which the unique itemset mining is a part, with an alternative. ...
    (comp.lang.fortran)
  • Re: Whats new in C?
    ... One advantage is that it is much easier to read in VLA form, ... This has been in Fortran since Fortran 66. ... allocation in Fortran until Fortran 90, ... an array of pointers and pass that. ...
    (comp.lang.c)