Calling a user specified function with array arguments in VBA

Calling a user specified function with array arguments in VBA

Post by David Gar » Tue, 17 May 1994 15:11:20



I am trying to write a simple ODE solver in VBA with a user-specified
function to determine the derivatives, and I can't seem to pass arrays
back and forth between the derivative function and the ODE routine.  I
have tried

  holding = Evaluate(deriv & "(x,y_0)")

where
  holding - a Variant to take the returned array
  x       - the independent variable in the ODE routine
  y_0     - the array of dependent variables in the ODE routine, a
            Variant
  deriv   - the name of the user-specified function, a String

Unfortunately, this doesn't seem to work.  Is it looking for y_0
on the worksheet where the ODE routine is called?  I also tried

  holding = Evaluate(deriv & "(" & x & "," & y_0 & ")")

but it didn't work either.  I'm a bit hazy on how VBA handles the
translation of the text string given to Evaluate, but I think the
first way doesn't work because Excel is looking for y_0 on the
worksheet where the ODE solver was called, and the second way doesn't
work because the contents of y_0 are being placed in the string
before the string is evaluated.

Is there some way I can have the user specify a function which
will accept and return arrays defined in the ODE routine?  Is this
method of calling a user-provided function the closest thing to
function pointers in C?  The lab is still waiting for the manuals,
but I've tried looking in Excel 5 books at the bookstores, as well
as the on-line help, without success.

Thanks,
David Garza

 
 
 

1. calling a pl/pgsql function with array in argument

Hello, i am tryin to pass an array like argument to a pl/pgsql function but
i can not find the correct data type in te function.

i am using php.

ex: $dato[][] is the array using php, and i need call:

1. $res = fn_vea ($dato);   ?????

2. in pl/pgsql CREATE FUNCTION fn_vea (integer [][]) RETURNS varchar (25) AS
.........

does it work??
thank you

---------------------------(end of broadcast)---------------------------

2. ObjectWindows 2.02 & dialog boxes.

3. passing arrays as arguments in vba

4. FS: SS20 system

5. Excel 5 - How to use Add-Ins Analysis functions in VBA

6. Replacement CD's? May have misplaced/lost ours.

7. plpgsql function with more than one array argument

8. about cache coherence

9. Call VBA Sub with arguments from Excel sheet

10. Using user-defined functions as add-ins?

11. calling function , passing OLD as argument

12. UML Sequence Diagram -- Can't add function call arguments!

13. Writing array to spreadsheet from VBA function in Excel