Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!ux1.lbl.gov!beard From: beard@ux1.lbl.gov (Patrick C Beard) Newsgroups: comp.sys.mac.programmer Subject: Re: print variables on screen ? Message-ID: <4558@helios.ee.lbl.gov> Date: 4 Jan 90 18:26:08 GMT References: <1837@ultb.isc.rit.edu> <5960@internal.Apple.COM> <33467@ucbvax.BERKELEY.EDU> Sender: usenet@helios.ee.lbl.gov Reply-To: beard@ux1.lbl.gov (Patrick C Beard) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 27 X-Local-Date: 4 Jan 90 10:26:08 PST In article <33467@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes: >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.: David's version assumed some things about vsprintf. Here is the more conventional way, and this does work under THINK C V4.0: #include void dprintf(char *sFormat, ...) { char sOut[256]; va_list pArgs; va_start(pArgs, sFormat); vsprintf(sOut, sFormat, pArgs); CtoPstr(sOut); DebugStr(sOut); } ------------------------------------------------------------------------------- - Patrick Beard, Macintosh Programmer (beard@lbl.gov) - - Berkeley Systems, Inc. "..............Good day!" - Paul Harvey - -------------------------------------------------------------------------------