From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5d47c120235ba244 X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: Text_IO.Get_Line Date: 1997/05/22 Message-ID: <01bc66f7$ed742b60$LocalHost@xhv46.dial.pipex.com>#1/1 X-Deja-AN: 243569036 References: <19970522184500.OAA10276@ladder02.news.aol.com> Organization: UUNet PIPEX server (post doesn't reflect views of UUNet PIPEX) Newsgroups: comp.lang.ada Date: 1997-05-22T00:00:00+00:00 List-Id: RE Hixon wrote in article <19970522184500.OAA10276@ladder02.news.aol.com>... > In your last message you suggested using Get_Immediate. According to all > my sources here it should work exactly the way that I want. I only have > one problem -- it doesn't. Cohen states in his book, Ada as a Second > Language, p. 769, that "Get_Immediate works just like the Character > version of Get, except that if the underlying operating system allows it, > unbuffered input is used." I guess that DOS 6.22 and Win 95 are two of > those operating systems that do not allow unbuffered input. On both > systems using GNAT 3.07, Get_Immediate did not recognize the character > input without pressing the ENTER key. Do you have any other suggestions > or ideas that would allow me to create interactive input using Ada 95 > and/or limiting the number of characters that a user can enter? Thanks in > advance. Yes, I do. The problem (I reckon) is that GNAT is still using _cooked_ input. You want uncooked. To do this you must call the DOS function called 'IOCTL'. How you do this, I'm not sure, to be honest. But, ultimately, you want to put 16#44# (function number 68) in the AH register, 16#01# (subfunction 1) in AL, the file handle (for keyboard input - usually 0) in BX, and 2#0000_0000_0010_0000# in DX, and then call interrupt 16#21#. You may want to test the C (carry) flag on return - it is set for error, and 0 for OK. I'll have a look at the GNAT documentation to see if it provides a facility for calling (DOS) interrupts. In the meantime: try for yourself! Post us (or mail me) how you get on. Good luck. Nick.