PASSPORT Knowledge Base
Macros

Date Published: May 09, 2008

Title

Accessing Variables From Multiple Subroutines

Product

PASSPORT PC to Host, PASSPORT Web to Host

Emulation Types

TN3270, TN5250, VT, SCO ANSI, Wyse 60

Issue

How can I access the same variable from multiple subroutines within a macro?

Solution

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

More Information

Keywords

record, macro, variable, global, multiple, subroutine