Duplication of variables in declarations area and procedure argume

F

forger

I needed to break up a long main procedure into sub procedures because of the
64K limit. The number of array variables needed for input to the spun-off
subprocedure were too many to fit into the sub arguments, because of the 21
continuation line limit, so I moved the array declarations into the General
Declarations Area above the main procedure, so that they would not need to be
passed in the arguments of the spun-off subprocedure. So far so good.
However, some of these arrays were already being passed thru the arguments of
other subprocedures in the program (which is all in one Worksheet Module). I
expected the compiler to complain and hilight the duplicate declarations (in
the General Declarations Area and sub arguments), but it didn't, and
compiled. I stepped thru the program: no problems so far.
Is this OK? I think that the reason why it works is because arrays are
passed ByRef, so the compiler doesn't care how the arrays are referenced, as
long as it knows where they are in memory. But I would like to be reassured
that this practice is OK.

It would be a laborious process to find all sub array arguments which are in
the General Declarations Area for all subs in the program, in order to remove
them from the arguments. And if it is unnecessary, then why bother? You know:
if it ain't broke, then don't fix it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top