System Variables - Built-In Script Variables
Â
In addition to user defined variables, the script engine can also make use of several "system" or "built-in" variables. Â Please note these variable names are case sensitive.
CursorLocation - provides access to the current cursor location. Â It can be used with the following script commands: appendtodisk, screentodisk and varextract.
Example:
REM Store the cursor location in 'cursor'
varextract "cursor,%CursorLocation%,10"
REM Display 'cursor' in a message box
message "%cursor%"
WindowsAppData - this provides the location of the currently logged in user's AppData/Roaming folder.
WindowsUserid - this variable will provide access to the ID of the user who is currently logged on to the PC.
MainFrameUserid - the first use of this variable in a script will issue a prompt for the user to "Please Enter your Mainframe User ID". Â The value entered will be stored in memory for use with all subsequent scripts.
MainFramePassword - the first use of this variable in a script will issue a prompt for the user to "Please Enter your Mainframe Password". Â The value entered will be stored in memory for use with all subsequent scripts. Â
The variables MainFrameUserid and MainFramePassword will be stored only in memory. Â They can be used by all instances of QWS3270 Secure, and will be deleted only after the last QWS3270 Secure window is closed. Â This means that the user can use these variables in a number of QWS3270 Secure sessions without having to re-enter them. These values will not be saved anywhere on disk or in any parameter setting.
If you need to reset the MainFrameUserid and MainFramePassword variables you can use the 'Tools/Reset System Variables' menu option or use the resetsysvars script command.
Example:
REM Display windows user name
type %WindowsUserid%
REM If this is the first use of this variable, the user
REM Â will be prompted for a value; otherwise, if a
REM different session has already used it, we will
REM just display it.
type %MainFrameUserid%
REM If this is the first use, prompt the user;
REM if this has been used before (in a different
REM instance of the application), display it.
type %MainFramePassword%
Â
Â