473,378 Members | 1,507 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,378 software developers and data experts.

CONSOLE: how to do "Press Any Key To Continue"

I'm using VB.Net. I've tried using Console.Read() but it requires a
line-terminator before it finishes (doesn't that mean it's functionally
equivalent to ReadLine() -- why have it then?). I've tried
Console.In.ReadBlock(), too, with no success.

So, along these lines, how would I implement, simply, a "Press Any Key to
Continue" routine or, more complex, a text menu in a Console app to get a
single character?

i.e.
1. Declare your hate for VB.Net
2. Declare your love for VB.Net
X. No Comment
Enter Your Choice [1,2,X]:

Thanks, folks.
Jul 21 '05 #1
2 4490
"Paul Johnston" <pjoh_DELETETHIS_nston@lw_DELETETHIS_cb.ca> wrote in message
news:uk******************@TK2MSFTNGP09.phx.gbl...
I'm using VB.Net. I've tried using Console.Read() but it requires a
line-terminator before it finishes (doesn't that mean it's functionally
equivalent to ReadLine() -- why have it then?). I've tried
Console.In.ReadBlock(), too, with no success.

So, along these lines, how would I implement, simply, a "Press Any Key to
Continue" routine or, more complex, a text menu in a Console app to get a
single character?

i.e.
1. Declare your hate for VB.Net
2. Declare your love for VB.Net
X. No Comment
Enter Your Choice [1,2,X]:


Console.In.ReadBlock(...) might be what you're looking for.
Jul 21 '05 #2
On Wed, 25 Feb 2004 13:45:48 -0500, "Paul Johnston"
<pjoh_DELETETHIS_nston@lw_DELETETHIS_cb.ca> wrote:
I'm using VB.Net. I've tried using Console.Read() but it requires a
line-terminator before it finishes (doesn't that mean it's functionally
equivalent to ReadLine() -- why have it then?). I've tried
Console.In.ReadBlock(), too, with no success.

So, along these lines, how would I implement, simply, a "Press Any Key to
Continue" routine or, more complex, a text menu in a Console app to get a
single character?

i.e.
1. Declare your hate for VB.Net
2. Declare your love for VB.Net
X. No Comment
Enter Your Choice [1,2,X]:

Thanks, folks.

You might need to wait until Whidbey is out - see these articles on
additional console-mode support in Whidbey (next version of Visual
Studio):

"Console Support In Whidbey
Whidbey is adding support for the full range of Console features
provided by Win32, such as manipulating the full console window,
applying colors, and reading directly from keyboard.
........
Keyboard input is accessed via the KeyAvailable, ReadKey,
TreatControlCAsInput members and the CancelKeyPress event. "
http://wesnerm.blogs.com/net_undocum...e_support.html

"Not Your Grandpa's Console
The BCL class that gains the most new features is the Console class.
Prior to the new features, the Console class allowed limited input and
output buffer access, and interactions limited to very linear
scenarios. Reading and writing task interactions with the screen
buffer were dictated by the simple Read, Write, ReadLine, and
WriteLine methods."

http://www.devx.com/codemag/Article/20150/0/page/5

Marc

Jul 21 '05 #3

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

Similar topics

3
by: Harman Sahni | last post by:
As per this URL http://msdn.microsoft.com/library/en-us/vjref98/html/14_14.asp?frame=true conitnue works on for, while, do... I know it works for foreach as well as I'm using it somewhere. My...
14
by: Daniel Bass | last post by:
is there an equivalent key word for C++'s "continue" in VB (.net) in this context? CString szLine; szLine = myReader.ReadLine(); while ( !szLine.IsEmpty() ) { if ( szLine(0) == '-' ) {
2
by: Paul Johnston | last post by:
I'm using VB.Net. I've tried using Console.Read() but it requires a line-terminator before it finishes (doesn't that mean it's functionally equivalent to ReadLine() -- why have it then?). I've...
8
by: Timur Ametov | last post by:
Hallo everybody. I'm using Visual Studio 7 and hier is my question. How can i see in Outputwindow after my Programm ended the message "Press any key to continue". Is it possible? Now this window...
9
by: Susan Rice | last post by:
I'm running a simple win32 console application and I want to impliment a "Press any key to continue", so I print that prompt, and then what's the easiest way to impliment reading any key? Do I use...
13
by: xz | last post by:
What if I want the following: vector<intv; // v is loaded by push_back() switch( v.size() ) { case 2: //do something
36
by: mdh | last post by:
May I ask the group this somewhat non-focused question....having now seen "continue" used in some of the solutions I have worked on. ( Ex 7-4 solution by Tondo and Gimpel comes to mind) Is there a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.