Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!hydroplane.cis.ohio-state.edu!spencer From: spencer@hydroplane.cis.ohio-state.edu (Stephen N. Spencer) Newsgroups: comp.sys.mac.programmer Subject: String to Float conversion woes... Message-ID: <74424@tut.cis.ohio-state.edu> Date: 28 Nov 89 01:29:48 GMT Sender: news@tut.cis.ohio-state.edu Reply-To: Stephen N. Spencer Distribution: usa Organization: The Advanced Computing Center for the Arts and Design Lines: 26 (Using THINK C 3.02 on a 1Meg Mac Plus...) Got an interesting problem. For an application I'm writing, I need to have the user enter several floating-point values into a dialog box. Set up the dialog box and the code to process events while the dialog box (modal) is up no sweat. Now I have to get the floating-point number from the dialog item. Here's the problem. I've done: GetDItem(myDialog, ID, &iType, &iHndle, &iBox); GetIText(iHndle, &iStr); where iStr is a Str255 variable. I see the "StringToNum" function but that won't do me any good. Spent most of last evening trying to convert that Str255 to a C string so I could do "atof()" but that didn't work either. And, interestingly enough, I must be using "PtoCstr()" incorrectly -- set it up just like my calls to "CtoPstr()" and the compiler complained of my call not matching the prototype. Any suggestions, folks? I'd really appreciate it. -=- Stephen N. Spencer |"For a successful technology, reality must take ACCAD, 1224 Kinnear Rd. | precedence over public relations, for Nature Columbus OH 43212 | cannot be fooled." - Richard P. Feynman spencer@heinlein.cgrg.ohio-state.edu OR spencer@cis.ohio-state.edu