Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
| |
|
|
You are not logged in.
Post a replyTopic review (newest first)
I didn't get that last part; but thanks for the explanation on ElseIfs.
Here's your main problem: Code:ElseIf test2 = TextWindow.Read() If test2 = "Testing Reply 2" Then You need to put your test on the same line as the 'ElseIf' like this: Code:ElseIf test2 = TextWindow.Read() If test2 = "Testing Reply 2" Then And immediately after the test, Small Basic is expecting a "Then," just like with the if statements: Code:ElseIf test2 = TextWindow.Read() Then If test2 = "Testing Reply 2" Then Also, you can't test if TextWindow.Read() is equal to the variable 'test2' because you haven't set it to anything yet. But you already set the "test" variable to TextWindow.Read() on the second line of your program. What I think you meant to do is something like this: Code:ElseIf test = "Testing Reply 2" Then Finally, with all that thinking, we get this: Code:TextWindow.WriteLine("Testing")
test = TextWindow.Read()
If test = "Testing Reply" Then
TextWindow.WriteLine("This is text.")
ElseIf test = "Testing Reply 2" Then
TextWindow.WriteLine("This is also text.")
Else
TextWindow.WriteLine("Sorry, this operation did not perform correctly.")
EndIfLine by line, the program says this:
ElseIfs... Sure! It was like this... Code:TextWindow.WriteLine("Testing")
test = TextWindow.Read()
If test = "Testing Reply" Then
TextWindow.WriteLine("This is text.")
ElseIf
test2 = TextWindow.Read()
If test2 = "Testing Reply 2" Then
TextWindow.WriteLine("This is also text.")
Else
TextWindow.WriteLine("Sorry, this operation did not perform correctly.")
EndIfAnd it never works!
Works fine over here. Your problem could be that you're entering "testing reply" instead of "Testing Reply".
C'mon, it was just an example. As I said, look at post #3.
Hi;
Have you understood what gAr said?
I'll try it, but the Microsoft Small Basic Curriculum were downloaded directly from the Microsoft official website.
Try 2 = signs anyway
2 = signs? According to Microsoft Small Basic Curriculum Lesson 1.4, (here is just an example:) you can do Code:If Clock.Day = 1 And Clock.Month = 1 Then
TextWindow.WriteLine("Happy New Year!")
EndIf'Ya see? Clock.Day = 1 and Month = 1. 1 equals sign.
Hey n872yt3r Code:If test == "Testing Reply" Then Put two equal signs there
I never recall posting a "newline character," I copied it right off my Microsoft Small Basic program.
Hi,
\n? I don't see \n. Maybe your browser uses Latex differently...
Hi, |