Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!asuvax!hrc!gtephx!pfluegerm From: pfluegerm@...!asuvax!gtephx (Mike Pflueger) Newsgroups: comp.sys.mac.programmer Subject: Re: THINK Pascal bug? (was Re: SFGetFile Problems in THINK Pascal 3.0.1) Summary: found it... Message-ID: <1991May15.200222.12702@...!asuvax!gtephx> Date: 15 May 91 20:02:22 GMT References: <5831@ns-mx.uiowa.edu> <1991May3.182555.10441@...!asuvax!gtephx> <1991May14.183620.7561@...!asuvax!gtephx> Organization: AG Communication Systems - Phoenix, AZ Lines: 47 In article <1991May14.183620.7561@...!asuvax!gtephx>, pfluegerm@...!asuvax!gtephx (Mike Pflueger) writes: > My original posting refers to a problem I am encountering in my application > when compiled with THINK Pascal 3.02 which happens to be shortly after an > SFGetFile (which another netter was posting about). If I say OK, my program > then moves to the folder containing the selected file, then does a > > "reset(file, filename);" > > to open the file read-only. Interactively, running within TP 3.01, it works > OK. When built/saved and run as a stand-alone application, I get a "runtime > error" on the "reset". It was developed and worked under TP 2.03, including > the stand-alone "built as application" version. Just recompiling under 3.01 > introduced the problem. (I have since done the 3.02 upgrade, and the problem > still exists.) I tried building with all the options (Debug, Names, oVerflow, > Range) turned off for that piece of code - problem still occurs. [ stuff deleted ] > What I HAVE found by debugging in MacsBug is that the compiler is inserting > some code to read (GetResource) the 'LSP ' resources numbered 2001 and 2002 > from my applications' resource fork. I assume these point to TP library > routines (e.g. the "reset") or something. Anyhow, the requested resource > doesn't exist (nil pointer) which the code handles by explicitly breaking > into the debugger (with _DebugStr), followed by an _ExitToShell. TP *did* > build an 'LSP ' resource 2000 into my application. Well, I found it. My fault I guess - when I switched from 2.03 to 3.01 and TP 3.01 rebuilt my project, I didn't replace the Interface.lib and Runtime.lib files in the project. I incorrectly assumed that TP really WAS converting the project. When I replaced these two files in my project with the 3.01 versions and rebuilt the application, everything worked fine. Now my question is - if TP is converting the project for a new version, why isn't it smart enough to replace libraries in the project with the new versions? Mike -- Mike Pflueger @ AG Communication Systems (formerly GTE Comm. Sys.), Phoenix, AZ UUCP: {...!ames!ncar!noao!asuvax | uunet!hrc | att}!gtephx!pfluegerm Work: 602-582-7049 FAX: 602-582-7624 Home: 602-439-1978 Packet: WD8KPZ @ KB7TV.AZ.USA.NA Internet: gtephx!pfluegerm@asuvax.eas.asu.edu