readline, then resume if no input

  • Thread starter Thread starter lyndon hughey
  • Start date Start date
L

lyndon hughey

Hello, I'm trying to create a console program that will allow one to enter
characters via the ReadLine() method. But I want to be able to use a
default value and resume processing if the user doesn't input a stream
within X seconds.

I was hoping that I could accomplish this without creating and killing
threads, as my expertise with this area of development is someone
undeveloped.

Could someone point me in the right direction please?

Thanks in advance.
 
lyndon hughey said:
Hello, I'm trying to create a console program that will allow one to enter
characters via the ReadLine() method. But I want to be able to use a
default value and resume processing if the user doesn't input a stream
within X seconds.

Try my Konsole class:
http://www.covingtoninnovations.com/michael/blog/0403/index.html#040313

Instead of creating threads, keep peeking to see if anything is available,
and read it as soon as it becomes available, or go on if the time runs out.
 
lyndon hughey said:
Thanks Mike.
Your Konsole class is just what i needed.
Lyndon

Glad to be of service! I wrote it in a fit of nostalgia for Turbo Pascal 3
:)
 
Back
Top