Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!claris!outpost.UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.programmer Subject: RE: Drawstring Question Message-ID: Date: 4 Dec 90 15:46:13 GMT Reply-To: time@tbomb.ice.com Organization: Peirce Software Lines: 26 X-Mailer: uMail - Mac Release: 0.1.4 In article <1CE00001.ale2i0@tbomb.ice.com>, time@tbomb.ice.com (Tim Endres) writes: > > > In article <31268.275A511A@stjhmc.fidonet.org>, Chris.Gehlker@p12.f56.n114.z1.fidonet.org (Chris Gehlker) writes: > > > Now there is a new problem: > > > Since I am using a drawing Window as my output medium, I can not use > > > the standard output functions (printf). I want to display the values of > > > some variables though. Since I have to use DrawString, this seems to be > > > a problem. For example, how do I draw a properly formatted floating > > > point number?? Drawstring does not give you formatting options and > > > seems to require a string. How do you get around this ?? Any ideas?? > --- OR --- > > static char drawf_string[512]; > > /* > ** NOTE: The limitation on the number of arguments. > ** You may specify more if you need them. > drawf(format_str, arg0, arg1, arg2, arg3, arg4, arg5) Why not make use of a variable size parameter list, then use vsprintf? K & R (at least the new ANSI version) discusses the use of these. Also look in StdArg.h & StdIO.h -- michael -- Michael Peirce -- {apple,decwrl}!claris!outpost!peirce -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- and Consulting -- (408) 244-6554