Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: print variables on screen ? Message-ID: <33467@ucbvax.BERKELEY.EDU> Date: 4 Jan 90 16:20:56 GMT References: <1837@ultb.isc.rit.edu> <5960@internal.Apple.COM> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 24 In article <5960@internal.Apple.COM> dowdy@apple.com (Tom Dowdy) writes: >I personally >usually prefer to see things in Macsbug, because usually this code is only >in for debugging. Tom is right, Here is dprintf() for THINK C.: dprintf(pat, arg)char *pat;int arg;{ char s[256]; s[0] = vsprintf(&s[1], pat, &arg) - 1; DebugStr((StringPtr) s); } Note, you'll need to have the sprintf library in your project. Also, I last ran this under THINK C v. 3. I'd check and see if V4 returns the count of characters generated from vsprintf(), in the manual, before trying to run this. > The mac is a detour in the inevitable march of mediocre computers. > drs@bnlux0.bnl.gov (David R. Stampf) --- David Phillip Oster -master of the ad hoc odd hack. Arpa: oster@dewey.soe.berkeley.edu Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu