Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!ukma!husc6!sri-unix!stores From: stores@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: How do I read a line? Message-ID: <32117@sri-unix.SRI.COM> Date: 24 May 89 23:56:08 GMT References: <10387@burdvax.PRC.Unisys.COM> Reply-To: stores@unix.sri.com (Matt Mora) Organization: SRI, Menlo Park, CA. Lines: 70 In article <10387@burdvax.PRC.Unisys.COM> dave@emerald.PRC.Unisys.COM (David Lee Matuszek) writes: >Dumb question time. > >I'm writing a program that interacts with the user via text >input/output (no flames, please!). Logically, the program looks like: > > repeat > write(Question); > read(Answer); > checkAnswer > until done > > >My preference would be to have the user input (typing) go into the >same text window that the program uses for output--just like on a >terminal--and I'd get the line when the user hit Return. I think I >could almost do this, if the user never backspaced, or used cut&paste. >Maybe I'm making the problem to hard by trying to allow these things? > >It seems that I should be able to use a modeless dialog (just leaving >it permanently on the screen). If I do, it would contain no text or >anything, just a text entry field. I can't seem to figure out how to >do this, either, and it would mean that the user had to continually >look back and forth between two windows; but it would be better than >nothing. > i'm not to clear on what you need. Are You using the text window in LSP or a regular window? I Don't see why you can't put both in one window. at the top of the window is a text box where you would display the questions and at the bottom would be the Textedit field for the answer. ________________________________________________________________________ | | | ________________________________________________________ | | | You Could Display your questions here in a text box | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --------------------------------------------------------- | | | | ________________________________________________________ | | | And here could be your textedit field | | | |_______________________________________________________| | ------------------------------------------------------------------------- Or you could use one big textedit filed as big as the window with scroll bars and parse the text of the editrecord for the answer. Maybe I'm missing something but your quextion is not to clear to me. -- ___________________________________________________________ Matthew Mora SRI International stores@unix.sri.com ___________________________________________________________