Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!tut.cis.ohio-state.edu!ukma!xanth!nic.MR.NET!ns!jmh From: jmh@ns.network.com (1606) Newsgroups: comp.sys.mac.programmer Subject: Dialog Crash Keywords: Get/Set IText? Message-ID: <1415@ns.network.com> Date: 30 May 89 16:15:45 GMT Sender: jmh@ns.network.com (Joel Halpern 424-1606) Reply-To: jmh@ns.UUCP (Joel Halpern 424-1606) Organization: Network Systems Corporation Lines: 40 In an application I am attempting to write, I have a dialog with one edittext item (item 2). When the dialog is requested from the menu, the routine starts with: char strbuf[60]; GetDItem(dialog, 2, handle); /* set the string at strbuf+1 to the desired display */ trbuf[0] = strlen(strbuf+1); SetIText(handle, strbuf); Then I enter a loop: do { ModalDialog(dialog, &theItem); if (theItem == 2) { GetDItem(dialog, theItem, handle); GetIText(handle, strbuf); /* process input */ } } while (theItem != 1 && tehItem != exititem); This all works fine the first time I call it. However, the second time, the whole system hands. If I run with LSC breakpoints inside this routine, it runs most of the time. I presume I am causing some kind of wandering memory reference. What? Any Comments or suggestions would be appreciated. Joel M. Halpern jmh@nsco.network.com Network Systems Corporation 612-424-1606 (office) 612-824-1375 (home evenings central time) p.s. obvious errors in the above may be due to not having the code in front of me, or may be due to my having not understood what I am supposed to do. Thanks in all cases.