PC Review


Reply
Thread Tools Rate Thread

Duplication of variables in declarations area and procedure argume

 
 
forger
Guest
Posts: n/a
 
      11th Apr 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Declaring Procedure Variables =?Utf-8?B?Q29yeQ==?= Microsoft Excel Programming 2 12th Dec 2005 07:13 PM
Declarations variables, Dim, some guidance please =?Utf-8?B?TmVhbCBaaW1t?= Microsoft Excel Programming 16 17th Aug 2005 08:49 PM
Declarations Procedure and Duplicate Declarations =?Utf-8?B?TmVhbCBaaW1t?= Microsoft Excel Programming 3 31st May 2005 01:01 AM
Procedure-Level Variables =?Utf-8?B?Q3JhaWc=?= Microsoft Access VBA Modules 4 28th Feb 2005 04:29 AM
Clarification on Procedure Declarations Matt Weyland Microsoft Access Form Coding 1 9th Jul 2004 07:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:01 PM.