comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: Text_IO.Get_Line
Date: 1997/05/22
Date: 1997-05-22T00:00:00+00:00	[thread overview]
Message-ID: <01bc66f7$ed742b60$LocalHost@xhv46.dial.pipex.com> (raw)
In-Reply-To: 19970522184500.OAA10276@ladder02.news.aol.com




RE Hixon <rehixon@aol.com> 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.





  reply	other threads:[~1997-05-22  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-17  0:00 Text_IO.Get_Line RE Hixon
1997-05-17  0:00 ` Text_IO.Get_Line Robert Dewar
1997-05-19  0:00   ` Text_IO.Get_Line RE Hixon
1997-05-19  0:00     ` Text_IO.Get_Line Matthew Heaney
1997-05-22  0:00   ` Text_IO.Get_Line RE Hixon
1997-05-22  0:00     ` Nick Roberts [this message]
1997-05-25  0:00     ` Text_IO.Get_Line Jerry van Dijk
1997-05-18  0:00 ` Text_IO.Get_Line Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox