SetEnv - sets the specified value into a local environment variable

Return to Introduction  Previous page  Next page

SetEnv(environment_variable,value)

Where:

environment_variableis a local environment variable name. The environment_variable may not contain embedded spaces. If the environment_variable does not already exist, it is created.
valuethe value assigned to environment_variable.

 

environment_variable and value may be TN3270 Plus variables.

 

The SetEnv command sets the value of a local environment variable. The local environment variable value is then accessible by other TN3270 Plus scripts. This makes it easy to pass information from one script to another. To access the value of a local environment variable, enclose the variable name in percent signs. Local environment variables persist until TN3270 Plus is closed.

Examples

SetEnv(PartNumber,78654)

SetEnv(Description,"Widget Maker")

SetEnv(RetailPrice,28.95)

MsgBox(%PartNumber%)

 

Sample Scripts

The first sample script assigns a value to a local environment variable.
The second sample script displays the value of the local environment variable in a message box.

 

' SetLocalEnvironmentVariable.txt

' Example that sets a local environment variable

SetEnv(PartNumber,78654)

exit

 

 

' DisplayLocalEnvironmentVariable.txt

' Example that displays a local environment variable

' in a message box

MsgBox(%PartNumber%)

exit

 

See Also:

 

Script Variables

SetUserEnv

Using the Scripting Language


TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.