Re: getc() ?? bug
- Posted by Kat <gertie at PELL.NET> Nov 20, 2000
- 420 views
On 21 Nov 2000, at 4:50, Derek Parnell wrote: > ----- Original Message ----- > From: "Bernie" <xotron at PCOM.NET> > To: <EUPHORIA at LISTSERV.MUOHIO.EDU> > Sent: Tuesday, November 21, 2000 3:57 AM > Subject: Re: getc() ?? bug <snip> > > The reason that euphoria is wrong is because it is trying to use the same > > function to get input from the keyboard. > > Sorry, but I don't get the connection? If you type in Ctrl-Z (ASCII-26) then > getc(0) will return -1. This is totally consistent, because stdin is a DOS > "text" device. To get the raw data from the keyboard is to open("CON", "rb") > but even this is not perfect solution, because a single Ctrl-Z on a line is > interpreted as EOF. > > In summary I believe that Euphoria is correct because it is implementing the > DOS standard. I think it is the DOS standard that has got it wrong. Unix has > no concept of binary/text files - they're all the same. Ok, my *one* cent worth..... I had this same problem in pascal yrs ago, i solved it with pascal's blockread() and wrote my own text parser. Then i found some bug i have since forgotten in the keybd read routine, and began bypassing dos for that too. Then i *needed* some binary file routines for text files, and darn it, had to goto assy routines for that too, to move the dos file pointer around. Or was it the other way around? Well, that's why this is only one cent, Jiri. Anyhow, use dos int21, function 14 and 15 to solve most problems. Are these covered in dos32lib, David? Kat