Trouble with my IF's
-
Im trying to write a program below. INPUT "Whats your name?"; NAME$ PRINT "Hello "NAME$" how are you doing today?"; INPUT "Good or Bad?"; EMOSTATE$ IF EMOSTATE$ = "Good" Then PRINT "Thats good, tell me about it!"; INPUT "Why is it a good day!?"; WHYG$ PRINT "Thats really cool!"; END IF IF EMOSTATE "Bad" Then PRINT "Aww, im sorry. Why was it so bad?"; INPUT "What was bad about your day."; WHYB$ It always error's out at the INPUT "Good or Bad?"; EMOSTATE$ Can any one help me? ><
-
Im trying to write a program below. INPUT "Whats your name?"; NAME$ PRINT "Hello "NAME$" how are you doing today?"; INPUT "Good or Bad?"; EMOSTATE$ IF EMOSTATE$ = "Good" Then PRINT "Thats good, tell me about it!"; INPUT "Why is it a good day!?"; WHYG$ PRINT "Thats really cool!"; END IF IF EMOSTATE "Bad" Then PRINT "Aww, im sorry. Why was it so bad?"; INPUT "What was bad about your day."; WHYB$ It always error's out at the INPUT "Good or Bad?"; EMOSTATE$ Can any one help me? ><
Hi, that is a great little program, but I doubt the C# compiler will accept any single line of it. What are you doing in this forum? BTW Most programming languages I am aware of know the concept of operators, such as + - = < > and many more. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Fixturized forever. :confused:
-
Im trying to write a program below. INPUT "Whats your name?"; NAME$ PRINT "Hello "NAME$" how are you doing today?"; INPUT "Good or Bad?"; EMOSTATE$ IF EMOSTATE$ = "Good" Then PRINT "Thats good, tell me about it!"; INPUT "Why is it a good day!?"; WHYG$ PRINT "Thats really cool!"; END IF IF EMOSTATE "Bad" Then PRINT "Aww, im sorry. Why was it so bad?"; INPUT "What was bad about your day."; WHYB$ It always error's out at the INPUT "Good or Bad?"; EMOSTATE$ Can any one help me? ><
Wow. It's a good thing you found this forum. Abandon this ugly excuse for a language and learn C# instead, you'll be glad you did. What is this ?
Christian Graus Driven to the arms of OSX by Vista.
-
Wow. It's a good thing you found this forum. Abandon this ugly excuse for a language and learn C# instead, you'll be glad you did. What is this ?
Christian Graus Driven to the arms of OSX by Vista.
Maybe he needz codez for a compiler?
-
Maybe he needz codez for a compiler?
-
That's really old BASIC.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Im trying to write a program below. INPUT "Whats your name?"; NAME$ PRINT "Hello "NAME$" how are you doing today?"; INPUT "Good or Bad?"; EMOSTATE$ IF EMOSTATE$ = "Good" Then PRINT "Thats good, tell me about it!"; INPUT "Why is it a good day!?"; WHYG$ PRINT "Thats really cool!"; END IF IF EMOSTATE "Bad" Then PRINT "Aww, im sorry. Why was it so bad?"; INPUT "What was bad about your day."; WHYB$ It always error's out at the INPUT "Good or Bad?"; EMOSTATE$ Can any one help me? ><
Wow! I haven't seen good old BASIC like that for years! It's like an old friend enemy revisiting. This is the C# forum in case you didn't realise. A rough mock up of your code in C# in case you want to give one of these new-fangled languages a try!
string name;
ConsoleKeyInfo emoState = new ConsoleKeyInfo();
string why;
Console.Write("What is your name? ");
name = Console.ReadLine();
Console.WriteLine(string.Format("Hello {0}, how are you doing today? ", name));
while (emoState.Key != ConsoleKey.G && emoState.Key != ConsoleKey.B)
{
Console.Write("Good (g) or bad (b)? ");
emoState = Console.ReadKey(false);
Console.WriteLine();
}
switch (emoState.Key)
{
case ConsoleKey.G:
Console.WriteLine("Thats good, tell me about it!");
Console.Write("Why is it a good day? ");
why = Console.ReadLine();
break;
default:
Console.WriteLine("Aww, im sorry.");
Console.Write("What was bad about your day? ");
why = Console.ReadLine();
break;
}
Console.Write("Press any key to exit...");
Console.Read();Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) -
That's really old BASIC.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Right. Do I dare reach over to my bookshelf to get my BASIC-Plus and Turbo BASIC books?