|
-
February 19th, 2010, 03:24 PM
#1
What is the code to make this in C#?
I am trying to do an console application. This application allows to user to prompt an input until user prompt the negative numbers. However, after an user typed a number, it terminates automatically. I want that the amount of value can be typed in the application in second time or third time until negative numbers. What is the code to make this in C#?
Kindest Regards
-
February 19th, 2010, 03:37 PM
#2
Re: What is the code to make this in C#?
have you tried the while loop ?
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback  you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
February 19th, 2010, 03:40 PM
#3
Re: What is the code to make this in C#?
I tried while, for loops and also if statment. But, all don't work.
-
February 19th, 2010, 03:54 PM
#4
Re: What is the code to make this in C#?
from the information that you share I suggest you write if(9 == -7) return +8....
can post some code, I don't feel like writing it from scrach today.
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback  you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
February 22nd, 2010, 12:59 AM
#5
Re: What is the code to make this in C#?
Have you tried a for loop and an if statement together?
Otherwise, as a last resort may I suggest.
Code:
using (HelpFile doc = new HelpFile())
{
doc.Read();
}
Last edited by rliq; February 22nd, 2010 at 01:02 AM.
Rob
-
Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......
-
February 22nd, 2010, 01:05 AM
#6
Re: What is the code to make this in C#?
Seriously, here's some pseudo code....
Code:
while (true)
{
// read some input from the keyboard
// if it is a negative number then
// break (out of loop)
}
Rob
-
Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......
-
February 22nd, 2010, 04:16 AM
#7
Re: What is the code to make this in C#?
 Originally Posted by aprilzoom
I tried while, for loops and also if statment. But, all don't work.
A few suggestions...
1. Try and post the code that you've got so far. It would make it easier for others to help you.
2. Try and give us some indication of your background and ability/experience.
To me it seems like you don't understand the nature of Console applications. Basically you have to keep reading for input from the user. Once you stop reading input then your program executes and terminates. Here's a link to get you started...Console.ReadLine
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|