none
The command "ElseIf" is not working RRS feed

  • Question

  • Hi Guys ,

    i have gotta a problem with "elseif'' , it's not working HERE :

    TextWindow.WriteLine("write your qusetion here ") 
    If TextWindow.Read() = ("2+2") Then 
      TextWindow.WriteLine("4") 
    ElseIf TextWindow.Read() = ("1+1 ?") then 
      TextWindow.WriteLine(" 2 ")
      EndIf 

    'the colors in the block above may be not clear because i didn't find small basic in the launguage menu'

    may you tell me why or give me a soultion for this please

    i just learned SmallBasic from while so JUST NOOB NEEDS HELP

    i wish you answer me !! regards

    Haydroid


    • Edited by Haydroid Wednesday, December 26, 2012 4:28 PM
    Wednesday, December 26, 2012 4:27 PM

Answers

  • Your problem is that Textwindow.read can only be use to read the text Above once.

    So try this.

    TextWindow.WriteLine("write your qusetion here ")

    Var = TextWindow.Read() If Var = ("2+2") Then TextWindow.WriteLine("4") ElseIf Var = ("1+1 ?") then TextWindow.WriteLine(" 2 ") EndIf



    A spark to start a fire is necessary. But mainly you need dry kindling.

    • Proposed as answer by Zock77Editor Thursday, December 27, 2012 1:37 AM
    • Marked as answer by Haydroid Thursday, December 27, 2012 1:22 PM
    Wednesday, December 26, 2012 5:23 PM
    Answerer