Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

GoTo Statement

  • Last UpdatedJul 18, 2023
  • 1 minute read

The GoTo conditional statement branches unconditionally and without return to the label specified in the GoTo statement. The label must be located in the same subroutine or function as the Goto statement.

<statement/s>
If <condition> then GoTo Label1
Else GoTo Label2
End If
Label1:
<statement/s>
GoTo Label3
Label2:
<statement/s>
GoTo Label3
Label3:
<statement/s>

In this example, VBA tests the If condition, and jumps to the part of the script that begins with the label "Label1:" if the condition was true, or jumps to the part of the script that begins with the label "Label2:" if the condition was false. This could be anywhere in the same subroutine or function.

See Also

Control Structures

Related Links
TitleResults for “How to create a CRG?”Also Available in