Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing variables back to main procedure Matt McQueen[_3_] Excel Programming 5 September 7th 07 02:39 PM
Declaring Procedure Variables Cory Excel Programming 2 December 12th 05 07:13 PM
Declarations variables, Dim, some guidance please Neal Zimm Excel Programming 16 August 17th 05 08:49 PM
Values assigned to variables staying in memory when procedure stop Peter Rooney Excel Programming 4 August 12th 05 03:13 PM
Declarations Procedure and Duplicate Declarations Neal Zimm Excel Programming 3 May 31st 05 01:01 AM


All times are GMT +1. The time now is 03:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"