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



On May 29, 4:57 pm, formulae translator <liwei19742...@xxxxxxxxx>
wrote:
....

I can NOT define more than one array in one line.
It's so strange because I never heard anyone mentioned this.

It's not that you cannot define more than one array (any variable
type, actually) on one line but that the syntax

Dim A As Integer, B

results in variable B being a Variant as it was not provided a type
and therefore, defaults to Variant. This is documented in VB albeit
in older versions a little obtusely but is well discussed in VB-
related newsgroups.

So, from your original posting,

Dim f_max, ppw As Double
Dim i, j, nt_out, nlayer, n_ma As Long
Static control(7), ma(100) As Long
....
Dim out_a(10000, 100)

each of the variables except in the first three lines are Variants
with the exception of the last one on each line which. In the last
line out_a is also a Variant array.

I'll make a side note for the future that if you had pared your
example down to something approaching the near minimum to demonstrate
the problem on the first post I probably would have taken the time to
look at it enough and spotted the issue. As it was, there was so much
stuff posted I didn't look at any of it.

.



Relevant Pages

  • Re: shape range help
    ... However initial use of Dim() avoided use of brackets and he ... Everytime with ReDim only, I get a Variant() ... never in a session I don't do the initial Dim varr() then redim does NOT ...
    (microsoft.public.excel.programming)
  • Re: Coding with varsortby and options
    ... Dim varhowsort As Variant ... DoCmd.OpenReport stDocName, acViewPreview ...
    (microsoft.public.access.formscoding)
  • Re: shape range help
    ... However initial use of Dim() avoided use of brackets and he ... Everytime with ReDim only, I get a Variant() ... Dim Stooges As ShapeRange ...
    (microsoft.public.excel.programming)
  • Re: OPENFILENAME A P I. User cancels ?
    ... The variable FName will be a Boolean False if no file was selected or a String containing the fully qualified file name if the user selectes a file. ... Const ahtOFN_OVERWRITEPROMPT = &H2 ... Function GetOpenFile(Optional varDirectory As Variant, ... Dim strFilter As String ...
    (microsoft.public.excel.programming)
  • Re: Array problem: Key words-Variant Array, single-element, type mismatch error
    ... Sub VariantArrayA() ... Dim u ... 'create 1st variant array ...
    (microsoft.public.excel.programming)