locked
Why doesn't my program work? RRS feed

Answers

  • you are never setting answer to be anything. Use the controls.GetTextboxText( textbox name ) method to get the contents of the Textbox.

     

    EDIT: tell a lie, i missed the bottom bit, its your or statement:

     

    Sub TextInput
     If(GraphicsWindow.LastKey = "Enter" Or "Return") Then 'If the key they pressed that brought them into the subroutine ...
      answer = Controls.GetTextBoxText(TextBox) '...was the Enter key, 'answer' gets a value and thus breaks the loop
     EndIf
    EndSub

    is wrong you need to change the if to this:

     

     If(GraphicsWindow.LastKey = "Enter" Or GraphicsWindow.LastKey = "Return") Then 
     As its not comparing anything to the Return text.

    • Proposed as answer by litdev Wednesday, July 28, 2010 9:57 PM
    • Marked as answer by ak9779 Wednesday, July 28, 2010 10:27 PM
    Wednesday, July 28, 2010 5:07 PM

All replies

  • you are never setting answer to be anything. Use the controls.GetTextboxText( textbox name ) method to get the contents of the Textbox.

     

    EDIT: tell a lie, i missed the bottom bit, its your or statement:

     

    Sub TextInput
     If(GraphicsWindow.LastKey = "Enter" Or "Return") Then 'If the key they pressed that brought them into the subroutine ...
      answer = Controls.GetTextBoxText(TextBox) '...was the Enter key, 'answer' gets a value and thus breaks the loop
     EndIf
    EndSub

    is wrong you need to change the if to this:

     

     If(GraphicsWindow.LastKey = "Enter" Or GraphicsWindow.LastKey = "Return") Then 
     As its not comparing anything to the Return text.

    • Proposed as answer by litdev Wednesday, July 28, 2010 9:57 PM
    • Marked as answer by ak9779 Wednesday, July 28, 2010 10:27 PM
    Wednesday, July 28, 2010 5:07 PM
  • Thank you very much, I'm a novice at the Or's and And's ad when to use them
    Wednesday, July 28, 2010 10:27 PM
  • Thank you very much, I'm a novice at the Or's and And's ad when to use them
    Basically just treat each and / or condition as a completely separate condition and all will work :)
    Wednesday, July 28, 2010 10:59 PM