LA said:
I want to direct the flow of a program using the value of a variable. How
is that done?
It can't be done with a label name.
The most common alternative is to use Select Case to direct
the flow to a code block:
Select Case stringvariable
Case "label1"
'code block for label1
Case "label2"
'code block for label2
. . .
Case Else
MshBox "no code block for label " & stringvariable
End Select
A more elaborate and arguably more flexible way could be to
use the Run method or the Eval function
Sub something(...
. . .
Run stringvariable
. . .
End Sub
or
Sub something(...
. . .
Eval(stringvariable & "()")
. . .
End Sub
and put each code block in its own procedure
Public Function label1()
'code block for label1
End Function
Public Function label2()
'code block for label2
End Function
. . .