Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!bonnie!akgua!mcnc!decvax!genrad!panda!talcott!harvard!seismo!brl-tgr!tgr!ihnp4!inuxc!pur-ee!CS-Mordred!Pucc-HPucc-I: ags@ucb-vax.ARPA; From: Pucc-HPucc-I:@CS-Mordred.UUCP Newsgroups: net.micro Subject: Turbo PASCAL quirk? Message-ID: <8541@brl-tgr.ARPA> Date: Sat, 23-Feb-85 13:30:41 EST Article-I.D.: brl-tgr.8541 Posted: Sat Feb 23 13:30:41 1985 Date-Received: Wed, 27-Feb-85 05:47:56 EST Sender: news@brl-tgr.ARPA Lines: 44 > What happens is that the line Sym_List := Nxt_Ident has no effect since > the With statement seems to lock you into the VALUE of the Sym_List > pointer when you enter the With statement. Is this standard PASCAL? > I assumed, obviously incorrectly, that this code is equivalent to the > same code without the With and with all of the record fields prefixed > with Sym_List^. The implementation is correct. According to the American Pascal Standard, The record-variable shall be accessed before the statement of the with-statement is executed, and that access shall establish a reference to the variable during the entire execution of the statement of the with-statement. The line Sym_List := Nxt_Ident does indeed have an effect (it changes the value of Sym_List), but it does not affect the record-variable access which is effective for the entire duration of the with-statement. By the way, underscores in identifiers are not standard Pascal. > Type > Ident_Ptr = ^Ident; > Ident = Record > Name : String[127]; > ID_Type : Ident_Type; > References : Line_Ref; > Nxt_Ident : Ident_Ptr; > End; > Var > Sym_List : Ident_Ptr; > > ... > > With Sym_List^ Do > Begin > While Name <> '' do > Begin > Writeln(Name); > Print_References(References); > Sym_List := Nxt_Ident; > End; (* While *) > End; (* With *) -- Dave Seaman ..!pur-ee!pucc-i:ags