[net.micro.pc] Reading control chars from Turbo

kumar@hplcea.UUCP (kumar) (11/26/84)

Has anyone tried control character I/O from Turbo Pascal?

I have been using Turbo to read control characters from the keyboard.
I have had no problems except the utter inability of Turbo to read
nulls (control-@) from the keyboard.  I tried the con, trm and kbd
device names, all without any success.  Has anyone else run into this
problem?  Is this a known Turbo bug?

jsoc@lasspvax.UUCP (John Socha) (12/02/84)

In article <> kumar@hplcea.UUCP (kumar) writes:
>
>I have been using Turbo to read control characters from the keyboard.
>I have had no problems except the utter inability of Turbo to read
>nulls (control-@) from the keyboard.  I tried the con, trm and kbd
>device names, all without any success.  Has anyone else run into this
>problem?  Is this a known Turbo bug?

This isn't a problem with Turbo Pascal, it's PC-DOS's fault.

PC-DOS uses the null character (control-@) as a special character.
Whenever you push a key that isn't part of the ASCII character set,
like the function keys, DOS sends two characters.  The first character
(an ASCII null) means that the next character is the scan code for
the key you pushed.  That means there's no way you can send a plain,
ordinary null character.

			John Socha
			Author of Assembly Language Safari on the IBM PC.
			{...}cornell!lasspvax!jsoc