Edit variables

Navigation:  Client commands > Tools > Client command editor > Menu bar >

Edit variables

Version 1.0.1

Variables are used to store certain values. Variables are available as project, console, system and global ACMP variables. These variables differ in regard to usage:

 

VariableType_Project

Project variables

These variables exist only in the current project and cannot be used in other projects.

 

VariableType_Global

Global ACMP variables

These variables are available throughout the ACMP environment and can be used in all projects, but they must be explicitly created.

 

VariableType_System

System variables

These variables describe the current system on which the Client Command is to be executed. They are used to easily read out computer-related values (names, directories, operating system). These variables can be read only.

 

Client

Console variables

These variables describe properties of the console and can be read only.

 

5.8.3.1.1.2 - Variablen

Project variables

 

Variables can be used directly with the notation %VARIABLENAME%. In this way, the content of the variable is inserted directly in the output.

 

Hinweis

Note:

If you don't want a variable to be resolved, use the following notation:

%%VARIABLENAME%%

 

This notation ensures that not the content of the variable, but its name, is displayed. Also note that % characters, when used under normal conditions, are always written with an additional preceding % character. This notation prevents ACMP from trying to interpret the text as a variable.

 

This is especially important if you use the Execute batch file command or similar commands in which enter source code. Make sure to escape all % characters as otherwise the script cannot be interpreted and executed correctly. This includes in particular variables in shell scripts, such as:

FOR %%i IN %%list DO (

   echo %%i

)

 

With the Project menu in the Client Command editor you can access the Edit variables option. There you will find all ACMP variables (name) with their current values and an option which indicates if the variables is editable (writable).

 

To add a new variable, enter the variable name and a default value, if necessary. By clicking the + button to the right of the variable name, you will add the variable to the ACMP variables and can use it in your commands.

 

When creating functions (see Manage functions), there is also the possibility to mark a variable as a parameter. Such variables can have values assigned dynamically.

 

If you click on the button to the right of the input for the default value, the entered value is set as the current value for the selected variable. So you can choose, for example, a start value and a default value (substitute value).

 

Hinweis

Note:

Since ACMP 4.0, the system variable LOGGEDONUSER_NAME has the value 'SYSTEM' if no user is logged on to the client.

 

Use of variables

Variables can transfer values to commands or act as substitute variables, and their content in turn transfers values in the following commands. You can change variable values ​​in your Client Commands with the Set project variables functions. If variable in question is one with a numerical value, such as a count variable in a loop, the value can be increased or decreased by using the Increase variable or the Decrease variable commands.

 

If a variable specifies a path, you should check if the specified path ends with or without a backslash. This is important if you expand the path manually to include a sub-folder structure, such as %windir%\system32\calc.exe. The internal ACMP paths specified always end with a backslash, while environment variables of the operating system do not always end with a final backslash. If you are not sure, you can automatically embed a final backslash by inserting a Delphi script (see Category Custom scripts) with the following content in a Client Command or a function:

 

 Var

      CurrentVarContent, NewVarContent: String;

 Begin

      CurrentVarContent := GetVarContent(‘Name of the variable to be checked‘);

      CurrentVarContent := IncludeTrailingPathDelimiter(CurrentVarContent);

      GetVarContent(‘Name of the variable to be checked‘, CurrentVarContent);

 End

 

If you want to enter a variable in a command, you can access a list of all available variables by using the key combination Ctrl + Space. If you want to enter the variables by hand, use the format %Variablenname%. If you need a set variable to have a specific value, you can enter this value with the format %Variablenname.Eigenschaft%.

 

For example:

In a Client Command you want to describe the URL variable with multiple values. To do so, create a variable named URL and enter properties in the following format:

 

Value=www.aagon.com,ClickedButton=ok

 

Several properties are separated in this case by a comma without a trailing space.

You can now access individual values with the name of the variables with your property:

 

%URL.Value% bzw. %URL.ClickedButton%

 

Variables should not contain an equals signs or a comma, as this may cause problems due to the parsing of Delphi.

Last change on 10.03.2014