Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!CS_UMBAUGH%uta.edu@RELAY.CS.NET From: CS_UMBAUGH%uta.edu@RELAY.CS.NET (Dave Umbaugh) Newsgroups: comp.lang.pascal Subject: Re: TP 3.01A -- known bugs list ?? Message-ID: <10210@brl-adm.ARPA> Date: Fri, 6-Nov-87 19:26:40 EST Article-I.D.: brl-adm.10210 Posted: Fri Nov 6 19:26:40 1987 Date-Received: Sun, 8-Nov-87 22:00:04 EST Sender: news@brl-adm.ARPA Lines: 30 In message <4993@vrdxhq.UUCP> Paul Paloski writes > . . . > > >I have a program which has been hand-tested by a couple people, most >exhaustively by myself. I have stepped through the many loops and Details omitted >A thought just occurred to me. Can static vs. dynamic scoping of >local/global variables be at fault ? In other words, if p2 has >variable ch AND main has variable ch, what will p3 use if referencing >ch ? I don't believe this is the problem (I don't code that bad ;-), >but I'm curious to know. Guess I'll check the manual. Anyone know >off the top of their heads ?? if p2 has variable ch AND main has variable ch, what p3 will use if referencing ch will depend on where the definition of p3 is in the static text. If p3's definition is a part of p2 then p3 is in the scope of p2 and p2's ch will "hide" the p1 ch. If, on the other hand, p3 is defined within p1 at the same level as the p2 definition then p3 will see the ch of p1. The dynamic scope here is irrelevent. In other words, it does not matter whether p3 is called from p2 or from p1. What matters is where the blocks (procedure definition) appear in the text. To clarify something in my second sentence -- if p1 and p2 are defined at the same level, then ch in p2 does not "hide" p1's ch since the ch from p1 would not have been visible in p2 anyway. :