Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!dslg0849 From: dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) Newsgroups: comp.lang.pascal Subject: Re: Why does this work in TP ? Message-ID: <1990Dec18.200336.13056@ux1.cso.uiuc.edu> Date: 18 Dec 90 20:03:36 GMT References: <25295@adm.brl.mil> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 29 C0361@univscvm.csd.scarolina.edu (Thomas Jenkins) writes: > The program below has an unusual feature. Is this considered a legal OOP > ability? See the question below after looking at the code. > > [Program ObjectTest] > > If you compile the above code, the output looks like: > > Testing nested methods. > Inside MethodA. > Calling nested method......In InMethodA! > ...In InMethodA! > > Isn't this a violation of scopeing rules? I notice this behavior in a large > object system and boiled it down to this. Anyone up to explaining this > behavior? Is this legal or a bug/feature/undocumented feature ( <-this last > one because I can't remember reading this as legal )? The second line of output is actually 'In MethodA'. Chapter 5 of the TP 5.5 OOP Guide, section 'Method calling conventions', states the following: Methods always use the FAR CALL model, regardless of the setting of the $F compiler directive. [Capitalization is Borland's] Thus there is no unusual feature in the program; it is a legal OOP ability; it is not a violation of scoping rules; it can be explained; and it is a legal documented feature. Daniel Lewart d-lewart@uiuc.edu