Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Duplication of variables in declarations area and procedure argume
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing variables back to main procedure | Excel Programming | |||
Declaring Procedure Variables | Excel Programming | |||
Declarations variables, Dim, some guidance please | Excel Programming | |||
Values assigned to variables staying in memory when procedure stop | Excel Programming | |||
Declarations Procedure and Duplicate Declarations | Excel Programming |