× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



hi Darren,

It's hard to say whether you're doing it "wrong," since I have only a high-level description of what you're doing.

In my experience, when a subprocedure has too many parameters, it usually indicates that the procedure is trying to do too many things. IMHO, a subprocedure should just do one thing -- and when the time comes to do the next thing, a separate procedure should be used. However, it's very difficult (for me, at any rate) to describe what constitutes "one thing."

And, there are certainly cases where a lot of data is required for just one thing.

Nesting data structures inside other data structures is a relatively simple solution -- but I find that when I do that, I have to work hard to keep the DS names short -- otherwise, it becomes very difficult to deal with the nested DS, the names quickly become too long.


On 7/24/2012 9:40 AM, darren@xxxxxxxxx wrote:

I have been using sub procedures exclusively in my code for about 3 years
now. One things that I continually have trouble with is a growing number
of parameters that I pass around. If one procedure gathers a bunch of data
and a couple different sub procedures need to process with that data, all
of that data has to be declared and passed. I'm talking about data
structure data, so lumping the variables into a data structure would mean
data structures within data structures. I've done this data structure
nesting before and it looks confusing when I come back to it later. What I
find myself wishing for is variables global to the current call level.
This could be accomplished with local subroutines I'd guess.

Am I doing it wrong?





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.