31
VB and the development of wizards / GoTo Statment?
« on: June 27, 2011, 08:42:23 AM »
I’m trying to set up a branching statement in a Macropump. I’m testing the following code in the VB Script Editor. I get this error message when executed: “Error on line 7- Label not defined” If I put the Label before the GoTo statement it will branch.
Dim torch As String
torch = isoutputactive(output1)
If torch = "true" Then
MsgBox " Back to manual control "
GoTo test
End If
Print torch
test:
Print "Ended"
The following from VB-Script-commands.pdf.
"Cypress Enable has complete process control functionality. The
control structures available are Do loops, While loops, For loops,
Select Case, If Then , and If Then Else. In addition, Cypress Enable
has one branching statement: GoTo. The Goto Statement branches to
the label specified in the Goto Statement.
Goto label1
.
.
.
label1:
The program execution jumps to the part of the program that begins
with the label "Label1:". "
Also is using Subs good practice in a Macropump.
I would appreciate a copy on someone’s macropump code that has Lables and Subs in it.
Thanks for any help in advance.
Tony
Dim torch As String
torch = isoutputactive(output1)
If torch = "true" Then
MsgBox " Back to manual control "
GoTo test
End If
Print torch
test:
Print "Ended"
The following from VB-Script-commands.pdf.
"Cypress Enable has complete process control functionality. The
control structures available are Do loops, While loops, For loops,
Select Case, If Then , and If Then Else. In addition, Cypress Enable
has one branching statement: GoTo. The Goto Statement branches to
the label specified in the Goto Statement.
Goto label1
.
.
.
label1:
The program execution jumps to the part of the program that begins
with the label "Label1:". "
Also is using Subs good practice in a Macropump.
I would appreciate a copy on someone’s macropump code that has Lables and Subs in it.
Thanks for any help in advance.
Tony