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



On May 30, 7:59 am, dpb <bozart...@xxxxxxxxx> wrote:
....
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.

Boy, I butchered that, didn't I? Sorry...

Each of the variables in the first three lines are Variants
with the exception of the last one on each line which is the type
specified. In the last line out_a is also a Variant array as no type
is provided.

Since I'm here anyway, I'll add a couple of other VB-related
comments...

As you chose to do, one of the recommendations often made in coding
style w/ VB is to make one declaration per line so as to avoid the
inadvertent lack of specific type declarations.

As w/ Fortran's Implicit None being an aid in finding type mismatches,
and typos, etc., VB has Option Explicit that serves much the same
purpose. It is also widely recommended to use that facility
universally. Unfortunately, by the design of VB it wouldn't have
identified the problem here specifically as the variables in question
were Declare'd but the syntax used made them Variant. :(



.



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: Custom functions calculating time arguments Help Desperate
    ... I tested the routine with data in the cells you identified and it worked OK. ... was going to be in the right internal format. ... |> Dim gameint As Variant ...
    (microsoft.public.excel.worksheet.functions)