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

Loops Question

Ok, I'm back. I have another question (probably an easy one, even to
non-experts). I was inspired to expand this little program (thanks to
all of your help). If I was using the following code to create a game
that prompts the user to guess a number from 1-100, and wanted to have
the console write a message Console.WriteLine("Invalid Entry") when the

user types in character(s) that are non-numerical - What would the
syntax be for this? Here's the code (which works great) but without
that new part.
Module Module1
Sub Main()
Const Value As Integer = 27
Dim Number As Integer
Console.WriteLine("Pick a number from 1 to 100")
Number = Integer.Parse(Console.ReadLine())
While Number <> Value
If Number < Value Then
Console.WriteLine("Higher")
Else
Console.WriteLine("Lower")
End If
Number = Integer.Parse(Console.ReadLine())
End While
Console.WriteLine("Correct!")
End Sub
End Module
Thank you,
Howard

Dec 21 '05 #1
3 1041
"Howard" <ho**********@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Ok, I'm back. I have another question (probably an easy one, even to


You know..... since this question shows in >=2 groups here and >=2 groups in
the VB Classic groups, I have to assume that you've never heard of
crossposting. There's never a reason to post a single question to multiple
groups, one at a time. It's a waste of time for you and a waste of time for
the people trying to help.

Learn to Crosspost. It's very easy. It's exactly like sending an email to
more than one person. A HUGE benefit is that A) you don't have to search all
groups in the list for answers to your question. Just check any of the
groups in your crosspost list. B) The people answering the questions won't
be wasting their time answering a question that has a stack of 20 or so in
another group. This is because, when you crosspost instead of multipost (as
you're doing now), all answers, no matter which group in your list they
originated from, will be connected and shown in a single thread, regardless
of which group in the list you (or the people answering) happens to be
looking at at the time. Crossposting saves time for everyone involved.
Multiposting wastes time for everyone involved. Since no one's getting paid
to post or answer questions here, choose the method that wastes the least
amount of time, for everyones sake.

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
Dec 21 '05 #2
Ken Halter <Ken_Halter@Use_Sparingly_Hotmail.com> wrote:
"Howard" <ho**********@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Ok, I'm back. I have another question (probably an easy one, even to


You know..... since this question shows in >=2 groups here and >=2 groups in
the VB Classic groups, I have to assume that you've never heard of
crossposting. There's never a reason to post a single question to multiple
groups, one at a time. It's a waste of time for you and a waste of time for
the people trying to help.

Learn to Crosspost. It's very easy. It's exactly like sending an email to
more than one person. A HUGE benefit is that A) you don't have to search all
groups in the list for answers to your question. Just check any of the
groups in your crosspost list. B) The people answering the questions won't
be wasting their time answering a question that has a stack of 20 or so in
another group. This is because, when you crosspost instead of multipost (as
you're doing now), all answers, no matter which group in your list they
originated from, will be connected and shown in a single thread, regardless
of which group in the list you (or the people answering) happens to be
looking at at the time. Crossposting saves time for everyone involved.
Multiposting wastes time for everyone involved. Since no one's getting paid
to post or answer questions here, choose the method that wastes the least
amount of time, for everyones sake.


While cross-posting is certainly better than multi-posting, I'd
encourage learning to work out the *single* best group to ask a
question in, and sticking to that one at least until it's clear that
no-one in that group knows the answer.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Dec 21 '05 #3
Thanks Ken,
You were correct in your thinking - I was not aware of the crossposting
feature (I'm new to not only to Visual Basic, but also to user groups in
general). I'll keep that in mind for the future. I also apologize if I
wasted your time.

Thank you,
Howard

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 21 '05 #4

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

Similar topics

15
by: JustSomeGuy | last post by:
I have a need to make an applicaiton that uses a variable number of nested for loops. for now I'm using a fixed number: for (z=0; z < Z; ++z) for (y=0; y < Y; ++y) for (x=0; x < X; ++x)
4
by: Dr. David Kirkby | last post by:
I have a program that loops through and changes all the elements on an array n times, so my code looks like this: for (n=1; n < n_max; ++n) for(i=imax; i >= 0; --i) { for(j=0 ; j < jmax; ++j) {...
46
by: Neptune | last post by:
Hello. I am working my way through Zhang's "Teach yourself C in 24 hrs (2e)" (Sam's series), and for nested loops, he writes (p116) "It's often necessary to create a loop even when you are...
6
by: Scott Brady Drummonds | last post by:
Hi, everyone, I was in a code review a couple of days ago and noticed one of my coworkers never used for() loops. Instead, he would use while() loops such as the following: i = 0; while (i...
17
by: John Salerno | last post by:
I'm reading Text Processing in Python right now and I came across a comment that is helping me to see for loops in a new light. I think because I'm used to the C-style for loop where you create 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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.