(Here's a small bit of code that shows what I mean:)

        // When this runs, type 123 and press return
        // I would expect it to process those characters
        // and then wait for more - but it exits
        // after the newline character

        using System;
        using System.IO;
        using System.Text;

        public class rtcs2 {
            public static void Main(String[] args) {
                while (true) {
                    int ch = P();
                    if (ch == -1) {
                        // No more characters available.
                        // End of file?
                        System.Console.WriteLine("bye!");
                        break;
                    }
                    ch = R();
                    System.Console.WriteLine("read: "+
                        ch+" ("+((char)ch)+")");
                }
            }

            private static int P() {
                int r = System.Console.In.Peek();
                System.Console.WriteLine("Peeking: "+r);
                return r;
            }

            private static int R() {
                int r = System.Console.In.Read();
                System.Console.WriteLine("Reading: "+r);
                return r;
            }
        }


_______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to