none
Yes or No ? RRS feed

  • Question

  • Hi folks. I have a question: can I make a program based on something like: write Y and then you'll get a positive response, write N and then you'll get a negative response.

    Thanks.

    Saturday, May 22, 2010 7:36 PM

Answers

  • Yes, you can. It is something like this as I understand you:

    While "True"
    TextWindow.WriteLine("Y/N")
    read = TextWindow.Read()
    read = Text.ConvertToLowerCase(read)
    If read = "y" Then
      TextWindow.WriteLine("Positive response")
    ElseIf read = "n" Then
      TextWindow.WriteLine("Negative response")
    Else
      TextWindow.WriteLine("Enter Y/N!")
    EndIf
    EndWhile

     

    I made it in console, because making in console it's easy, but if you want, you can realize it in graphics

    • Marked as answer by loleq12 Sunday, May 23, 2010 7:59 AM
    Saturday, May 22, 2010 8:10 PM

All replies

  • Yes, you can. It is something like this as I understand you:

    While "True"
    TextWindow.WriteLine("Y/N")
    read = TextWindow.Read()
    read = Text.ConvertToLowerCase(read)
    If read = "y" Then
      TextWindow.WriteLine("Positive response")
    ElseIf read = "n" Then
      TextWindow.WriteLine("Negative response")
    Else
      TextWindow.WriteLine("Enter Y/N!")
    EndIf
    EndWhile

     

    I made it in console, because making in console it's easy, but if you want, you can realize it in graphics

    • Marked as answer by loleq12 Sunday, May 23, 2010 7:59 AM
    Saturday, May 22, 2010 8:10 PM
  • Thanks.
    Sunday, May 23, 2010 7:59 AM