Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!cica!iuvax!rutgers!netnews.upenn.edu!grad1.cis.upenn.edu!isler From: isler@grad1.cis.upenn.edu Newsgroups: comp.sys.mac.programmer Subject: Floating Point #'s as Strings in Dialogs using Think C 3.0 Keywords: Getting garbage in TextItems...how come? Message-ID: <25837@netnews.upenn.edu> Date: 8 Jun 90 16:38:34 GMT Sender: news@netnews.upenn.edu Reply-To: isler@grad1.cis.upenn.edu () Distribution: na Organization: University of Pennsylvania Dept. of Computer Science Lines: 40 I am writing a program in Think C 3.0 in which I would like to convert floating point numbers to strings and place them in EditText items in a dialog box. my code looks like this: { . . . . Str255 str; float Value; Handle myHandle; Handle myBox; DialogPtr theDialog; theDialog = GetNewDialog(IdNumber, 0, - 1); GetDItem(theDialog, itemnum, &myType, &myHandle, &myBox); sprintf(str, "%3.1f", value); SetIText(myHandle, str); . . . } The result is that garbage is printed in the dialog instead of the converted string. The above conversion method works fine when I am displaying floats as strings in windows, but it does not work here. Any suggestions? S-K ISLER isler@grad1.cis.upenn.edu