To make the system more robust in response to system and directory changes,
you can use variables in your commands. For example, if the
path to your version control system's executable is changed, and you have used
a variable instead of a hard-coded path in your commands, you only need to edit
that path in one place, and all commands using the variable will now use the
updated path. The syntax is that of SH (the standard Unix shell). So, if in
a command, you want to refer to a variable called USER
, you would
refer to it in the text of the command as ${USER}
.
Each variable has its own name, label, status (if it is a "basic" variable), and value. If the variable is "basic", it is displayed in the Customizer Dialog where its value can be set. The label property is the label which is displayed in the Customizer Dialog for that variable.
A simple example of this functionality would be:
MESSAGE="Hello World"and then define the SHOWMESSAGE command as:
cmd.exe /x /c "echo ${MESSAGE}"Given these two lines, the actual command line that is issued to the shell to execute the SHOWMESSAGE command is
cmd.exe /x /c echo Hello WorldTo view the result of this command, you must check the "Open output dialog" checkbox.
There are three groups of variables:
User
variables:
You can define user variables and use them wherever needed.Runtime variables:
Dynamically supplied from the Forte for Java IDE
to the command each time it is executed.
Special
variables:
PASSWORD
- If you use this variable in the command, you will be prompted for
the password once in the session.<,/li>
POSSIBLE_FILE_STATUSES_LOCALIZED
- Labels that will be
used as statuses in [] after the name of the file. Strings in this variable
are order sensitive. The first string will be used for the file in Up-to-date
state, next for Locally Modified
etc., according to the POSSIBLE_FILE_STATUSES
variable.REASON
- If you use this variable in the command, you will be prompted for
it each time the given command is executed. The text you enter will
be recorded as the reason for changes to the file in the revision history
of that file.