Xref: utzoo comp.lang.pascal:3821 comp.sources.wanted:12556 Path: utzoo!attcan!uunet!bu.edu!xylogics!transfer!crackers!m2c!umvlsi!dime!smectos!eli From: eli@smectos.gang.umass.edu (Eli Brandt) Newsgroups: comp.lang.pascal,comp.sources.wanted Subject: Re: Mouse support for Turbo Pascal 5.5 Message-ID: <17165@dime.cs.umass.edu> Date: 19 Jul 90 17:04:48 GMT References: <90197.213141EX0@psuvm.psu.edu> <1990Jul18.055406.17988@uwasa.fi> Sender: news@dime.cs.umass.edu Reply-To: eli@smectos.CS.UMASS.EDU (Eli Brandt) Followup-To: comp.lang.pascal Organization: University of Massachusetts, Amherst Lines: 46 program BugTest; { Demonstrates a bug in the integrated debugger in TP 5.5 In the IDE, run the program to the marked line. Then evaluate v1 or its components. Note the absurd results. (I got 1.8E-37, 4E-5, 5E-5 or some such) This may be a result of the debugger's looking in the old stack context; I don't know. Also note that the values print out correctly; the fault is that of the debugger. The simplest way to work around this problem is to declare v1 as a var parameter, as indicated. As the compiler treats the existing declar- ation as a var parameter anyway, this makes no functional difference to the program. Note: the same results (well, different nonsense) are obtained with Turbo Debugger 1.5 System: IBM PS/2 50 DOS 3.3 Turbo Pascal v5.5 (file size 156321; date 5-2-89) No autoexec.bat; no config.sys Eli Brandt 7/10/90 } type vec3 = record x, y, z: real; end; procedure ReceiveVec(v1: vec3); { or "var v1: vec3" to fix } begin { <-- run to this line *** } writeln(v1.x, ' ', v1.y, ' ', v1.z); end; procedure passvec; var v: vec3; begin v.x := 1; v.y := 2; v.z := 3; ReceiveVec(v); end; begin passvec; end.