Environment Variables
Environment variables can be defined and used at different levels in TPT. They can be used in file paths, names, scripts and so forth. They use the ${<variable_name>}
syntax. For example, ${tpt.tptfile.dir}\myfile.txt addresses a file myfile.txt in the same folder as the current TPT file, see Execution Configuration Variables.
In TPT, you can use:
- Windows environment variables
- Global Variables
- Project-specific Variables
- Platform Configuration Variables
- Execution Configuration Variables
tpt.tptfile.dir
does not exist, since TEMP
is the default substitute.
TPT does not change WINDOWS environment variables. These variables do not appear in the list when you use the auto-completion feature. The following table lists two examples:
Name | Format | Description |
---|---|---|
${TEMP}
|
text | WINDOWS temp folder |
${COMPUTERNAME}
|
text | WINDOWS computer name |
${TIME}
|
text | WINDOWS time |
${DATE}
|
text | WINDOWS date |
Hierarchy of environment variables
Environment variables can be overwritten with the precedence: WINDOWS environment variables < global variables < project-specific variables < platform configuration variables < execution configuration variables.
This means, global variables prevail WINDOWS environment variables. Project-specific variables prevail global variables and WINDOWS environment variables. Platform configuration variables prevail project-specific variables, global variables , and WINDOWS environment variables. Execution configuration variables prevail all.