locked
GOTO seems to be broken in 0.9 RRS feed

  • Question

  • GOTO seems to be broken in 0.9 (yes, I have a hard time beliving it) ..but my code has:

    ElseIf (I = 3) Then
      TextWindow.Write("Running I=3")
      Goto LN4000

     

    LN4000:
    textWindow.Write("Running LRS")

     

    I seethe Text "Running I=3" and it never prints out the "Running LRS" nor does it execute the code underneath it.

    Friday, October 29, 2010 2:54 AM

Answers


  • Doug Acker,

    Try this.

    i=3
    if (I = 3) Then
      TextWindow.Writeline("Running I=3")
      Goto LN4000
    endif

    LN4000:
    textWindow.Writeline("Running LRS")
    TextWindow.Writeline("Done")

    Jricestk


    Jricestk
    • Proposed as answer by litdev Saturday, October 30, 2010 5:16 PM
    • Marked as answer by litdev Wednesday, November 10, 2010 8:05 PM
    Friday, October 29, 2010 2:34 PM
    Answerer

All replies


  • Doug Acker,

    Try this.

    i=3
    if (I = 3) Then
      TextWindow.Writeline("Running I=3")
      Goto LN4000
    endif

    LN4000:
    textWindow.Writeline("Running LRS")
    TextWindow.Writeline("Done")

    Jricestk


    Jricestk
    • Proposed as answer by litdev Saturday, October 30, 2010 5:16 PM
    • Marked as answer by litdev Wednesday, November 10, 2010 8:05 PM
    Friday, October 29, 2010 2:34 PM
    Answerer
  • Doug, without the full code it is hard to be sure what the problem is.  One possible reason is that you cannot do a GoTo jump into or out of a subroutine, since this would corruput the call stack (a list of where a call to a subroutines was made from, so it can return to where it was called from after it ends).  If you jump into or out of a subroutine with GoTo, then the call stack gets corrupted because you don't enter or leave the subroutine by the usual Sub or EndSub statements.
    Tuesday, November 2, 2010 10:03 PM