Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!emory!gatech!purdue!haven!adm!news From: Bob_Slomcenski.WBST129@xerox.com Newsgroups: comp.lang.pascal Subject: Re: Question about turbo pascal 5.5 Message-ID: <25898@adm.brl.mil> Date: 8 Feb 91 16:11:58 GMT Sender: news@adm.brl.mil Lines: 30 Gert, I think you may have uncovered a true bug. I can find nothing in the Turbo manual that explicitly prohibits the "WITH y" form. However, it appears to me that the problem lies in de-referencing the variable "y" before the object has been initialized. According to the Turbo 5.5 OOP manual (Instance Initialization, page 79): If an object contains virtual methods, then instances of that object type must be initialized through a constructor call before any call to a virtual method. Your example does not indicate if the object contains any virtual methods. If it does, perhaps the problem is that the WITH construct attempts to open the scope of "y" before a virtual method table (VMT) has been established. That is, using "WITH y" allows access to any field or method defined in the object, but before calling its constructor this access is invalid. I am not familiar with Turbo's internal representation of the WITH construct, but this does appear to be an inconsistency in the behavior that I would expect. Did you try the following: WITH y DO BEGIN y.Init(.....); { note explicit use of "y" } {...} END; Bob.