Re: strange arguments passing problem (from vba to fortran dll)



On May 29, 2:50 am, Arjen Markus <arjen.mar...@xxxxxxxxxx> wrote:
On 29 mei, 00:01, formulae translator <liwei19742...@xxxxxxxxx> wrote:

Dear all,

I encounter a strange problem when I am trying to pass arguments from
VBA (excel 2003) to fortran dll (compiled using CVF 6.6b).

debug in cvf environment shows some of the arguments are passed
correctly while some are not.

I attached part of the code here. The arguments passed correctly are
f_max, ppw, ma, para_H2. For other array arguments, only the first
elements are passed correctly.

any comments or suggestions are appreciated.

It looks as if only the scalar variables are passed correctly.
That does seem to make sense to me:

In VB you need to pass arrays like: ByRef array() As Double

In the code you posted the interfaces are missing the ().

Regards,

Arjen

Dear Arjen,

Thanks a lot for your prompt reply.

I tried the way you suggested, but got a compilor error (type
mismatch) from VBA.

The example in CVF document also has no "()" in "byref array as
double".

except for the two scalars (F_max and ppw), I have two arrays (ma and
para_H2) passed correctly.

I suspect the reason is that total size of arguments exceeds some
limit, but I am not sure because I cannot find any evidence to support
this.

Wei

.



Relevant Pages

  • Re: using fortran intrinsic functions in mex-file
    ... LOGICAL FUNCTION LSAME ... These programs must be called using F90 style array ... Scalar Arguments .. ... Purpose ...
    (comp.soft-sys.matlab)
  • [ANNOUNCE] New module Class::IntrospectionMethods
    ... access plain scalars, array, hash. ... These scalar, hash or array can ... object can be queried for the container object. ... parent object (the one constructed by Class::IntrospectionMethods ...
    (comp.lang.perl.modules)
  • Re: Another Perl datatype headache ( scalars $, hashes %, and arrays @ )
    ... > If I want to add Hash keys to another Hash, ... > Usually, I use scalar @array; ... $#array is not the length of the array. ... If you are sure your sub is called: ...
    (perl.beginners)
  • Re: operator overloading ... for numerical classes only
    ... The restriction to "scalar" types is meant to include complex numbers, ... and array code would be more similar? ... An ordered sequence type would ... sequence of data should be a List or an array. ...
    (comp.lang.java.programmer)
  • Re: Question about minloc
    ... why is it necessary to specify dim=1 ... Because the MINLOCintrinsic returns a 1-D array of minimum indices, ... returns the scalar minimum index for the specified dimension. ... if the DIM argument *weren't* present, ...
    (comp.lang.fortran)