View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier[_9_] Jon Peltier[_9_] is offline
external usenet poster
 
Posts: 146
Default Passing large number of variables to function

I'd say you should either do the array coding, or perhaps investigate
passing all the variables within a collection.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


RB Smissaert wrote:

Trying to find the best solution to the following:
I have a number of Subs in different modules that are using the same
function.
These Subs have to pass a large number of variables of different types
(boolean, byte, long, string) to this function.
I can't use these variables directly as arguments in the function as
there will be an error, number of arguments too large.
I could solve this by making a UDT, but the problem is that this UDT
then has to be declared publicly to be accessible
from the different modules. This seems to be against the general
principle that the number of public variables should be as small as
possible.
Another option would be to use a number of arrays, one for each
datatype, but this involves a lot more coding.
Any suggestions what the best approach is for this?

RBS