Jump to content


VBScript - GoTo line dow not works


  • You cannot reply to this topic
No replies to this topic

#1 tracciatura.net

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 18 May 2019 - 06:46 AM

Hi there, I'm trying to use Goto but give me an error at line "GoTo Line1"

Call gotoStatementDemo

Sub gotoStatementDemo()
		number = 1
		' Evaluate number and branch to appropriate label.
		If number = 1 Then
				GoTo Line1
		Else
				GoTo Line2
		End If
		Line1:
		sampleString = "Number equals 1"
		GoTo LastLine
		Line2:
		'The following statement never gets executed because number = 1.
		sampleString = "Number equals 2"
		LastLine:
		' Write "Number equals 1" in the Debug window.
		ThisDrawing.Utility.Prompt sampleString
End Sub






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users