473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

readline, then resume if no input

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.
Nov 16 '05 #1
3 1150

"lyndon hughey" <ly******@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
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/...ex.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.
Nov 16 '05 #2
Thanks Mike.
Your Konsole class is just what i needed.

Lyndon

"Michael A. Covington" <lo**@www.covingtoninnovations.com.for.address> wrote
in message news:eh**************@TK2MSFTNGP09.phx.gbl...

"lyndon hughey" <ly******@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
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/...ex.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.

Nov 16 '05 #3

"lyndon hughey" <ly******@hotmail.com> wrote in message
news:uq**************@TK2MSFTNGP12.phx.gbl...
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
:)


"Michael A. Covington" <lo**@www.covingtoninnovations.com.for.address> wrote in message news:eh**************@TK2MSFTNGP09.phx.gbl...

"lyndon hughey" <ly******@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
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/...ex.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.


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Guy | last post by:
Ok this is might take some exsplaining as this is just example code, I have a telnet server which I've created, its ment to be a a process queue control thing. One of the things I think that would...
2
by: washu | last post by:
Hi, This may be a simple problem but I can't seem to find a way around it. I've pasted my code snippet below: import os input = os.popen("echo hello") input.readline() input.readline()
0
by: John C. Worsley | last post by:
I've got an extremely inscrutable problem here using Perl's Term::ReadLine::Gnu module. I'm using Perl 5.8.0, readline 4.3 and Term::ReadLine::Gnu 1.14. The problem is specific to catching INT...
5
by: Andy Mee | last post by:
Hello one and all, I'm developing an Asp.NET system to take a CSV file uploaded via the web, parse it, and insert the values into an SQL database. My sticking point comes when I try to split()...
11
by: William Stacey [MVP] | last post by:
Trying to test a simple console app that reads from standard in if you pipe input into it like: "c:\ type config.txt | consoleinput.exe" Seem to run into an issue. It seems like if you use a...
8
by: Ron | last post by:
Hi all: I have an asp.net (using SQLserver) page in a class registration application where a supervisor can register for multiple employees. If there are no errors, duplicates the program flows...
2
by: SriBhargav | last post by:
Hi, I've a question on setting timeout on console.readline() I would like the user to input something through Console.readline() in 5 secs. If there is no input in that time, I would like to...
0
by: 7stud | last post by:
Hi, 1) Does this make any sense: """ Thus, the loop: for line in f: iterates on each line of the file. Due to buffering issues,
4
by: =?Utf-8?B?c2FtMDFt?= | last post by:
just as the subject states, I need to find a way to read each line from a multiline variable without having to write the string out to a file so I can stream it in and use ReadLine(). Below is a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.