Steve,
You probably should do a readline. The reason for this is that when
dealing with console input, the buffer is not going to be filled until a
line is entered. Because of this, it's easier to just read the line and
process the string than it is to read character by character.
In .NET 2.0 however, there are ways of detecting when there is a
keypress, which might be of use to you.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"- Steve -" <se****@foundation.sdsu.edu> wrote in message
news:u$**************@TK2MSFTNGP14.phx.gbl...
char letter = (char)Console.Read();
The first time through it is fine. The second time I can see in the
debbuger the a line feed is already in there.
I'm using Read instead of ReadLine becuase I just want a single char
instead of a string, and it seems like it would be simplier to do it this
way.
Of course depending on what it takes to get around this issue I might
change my ind.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:uu**************@TK2MSFTNGP15.phx.gbl... Steve,
Can you show the code where this is happening? Console.Read shouldn't
be feeding you the line character (I think).
If anything, why not use ReadLine?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"- Steve -" <se****@foundation.sdsu.edu> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Okay I call Console.Read() twice. However when I come up on my second
Console.Read() ASCII character 10 is already on the console (that's a
line feed).
How do I clear out that line feed before I call Console.Read() again?