Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!apple.com!chewy From: chewy@apple.com (Paul Snively) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW Pascal and libraries Message-ID: <7195@goofy.Apple.COM> Date: 15 Mar 90 00:39:54 GMT Sender: usenet@Apple.COM Distribution: na Organization: Apple Computer, Inc. Lines: 45 References:<958@uvicctr.UVic.CA.UUCP> <7180@goofy.Apple.COM> <10938@claris.com> In article <10938@claris.com> drc@claris.com (Dennis Cohen) writes: > >Among other things, Inside Macintosh documents NumToString, which takes an > >INTEGER and a VAR STR255, e.g.: > > Not wanting to contradict you, Paul, but NumToString takes a LongInt, not an > Integer. (PACK 7) > > >VAR > > theErr: INTEGER; > > tempString: STR255; > >... > >NumToString(theErr, tempString); > >... > > >This will convert theErr to a string, which you can then do whatever you > >wish with. > > Obviously, what Paul recommends will work because the Pascal compiler will > extend theErr to a LongInt when it passes it to the Toolbox. > > Dennis Cohen > Claris Corp. Thanks to Pete Gontier and Dennis Cohen for cleaning up after me; NumToString does indeed take a LONGINT and still works with my example (which I stole right out of some of my own code) for precisely the reason that Dennis says; Pascal sign-extends integers for you if you pass them where you should be passing a LONGINT. __________________________________________________________________________ Paul Snively Macintosh Developer Technical Support Apple Computer, Inc. 1st Choice: Paul_Snively.DTS@qm.gateway.apple.com 2nd Choice: CHEWBACCA@applelink.apple.com Last Choice: chewy@apple.com Just because I work for Apple Computer, Inc. doesn't mean that I believe what they believe, or vice-versa. __________________________________________________________________________