Accessing Variables From Multiple Subroutines
PASSPORT PC to Host, PASSPORT Web to Host
TN3270, TN5250, VT, SCO ANSI, Wyse 60
How can I access the same variable from multiple subroutines within a macro?
You can declare the variable before Zmain subroutine and this will allow you to access the variable from all subroutines contained in the macro.
Sample:
testvar = GetString( 6,19, 4)
Sub ZMain()
msgTestvar = MsgBox (testvar)
Call mysub()
End Sub
Sub mysub()
msgTestvar = MsgBox (testvar)
End Sub
Note: The variable can only be defined once. You cannot define the variable at the start of the macro and redefine it from within your subroutines.
record, macro, variable, global, multiple, subroutine