From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1a88c4d509f6381 X-Google-Attributes: gid103376,public From: fluffy_puff@dsuper.net Subject: Re: scope and/or parameters (beginner) Date: 1999/04/10 Message-ID: <370f88bb.1562410557@news.dsuper.net>#1/1 X-Deja-AN: 465037971 Content-Transfer-Encoding: 7bit References: <37064309.889106243@news.dsuper.net> <37084459.8616007@rocketmail.com> <370b0c99.1137352783@news.dsuper.net> <7ei04q$o$1@nnrp1.dejanews.com> Content-Type: text/plain; charset=us-ascii Organization: Delphi SuperNet Inc. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-04-10T00:00:00+00:00 List-Id: On Thu, 08 Apr 1999 10:24:29 GMT, czgrr wrote: >> The fact that a sub-program is declared INSIDE another, as >> opposed to OUTSIDE of it, makes no difference from the point of >> view of the compiler. As long as any call to a sub-program is >> made AFTER its declaration it is treated exactly the same way. >The short answer: >For the usage you gave in your original message, yes it makes no difference. > >The long answer, part 1: > >It does make one important difference. In the same way as local variables are >not accessible outside the routine they are declared in, declaring a routine >inside another limits the scope (accessibility) of that routine. I should have said "as long as the sub-program called is 'visible' or 'within the scope' instead of 'declared before'". >The long answer, part 2: > >This business about calling something after its declaration, ... >Of course, if you have written specs and bodies, this is exactly the same as a >declaration in the spec - you can think of a spec as coming "before" anything >in the body, and so you can call anything in a package's spec from anywhere >within that package. > >Phew! Some more things to play with, eh? >HTH, czgrr. Thanks for part 2. We haven't, in my course, written *specs* and *bodies*. I'll soon enough learn the .ADS/.SPC and .ADB/.BDY files relations. All I've done so far is register an .ADS file and an .ADB file in a Project to use the sub-programs they contain (a version of the ANSI "Screen" package). Thanks again. Marc -- What I really am is "fluffy", no "_dong", no "_puff", no "_woo", no nothing, just plain fluffy.