Environment Variables - Append

Declaration

<AMAPPENDENVIRONMENT NAME="text" 
TYPE="text(options)" 
VALUE="text" 
RESULTVARIABLE="text" />

Description: Appends text to a user, machine or process level environment variable and populates an existing variable with the resulting value.

IMPORTANT: Any user can add, modify, or remove a user environment variable. However, only an administrator can add, modify, or remove a system environment variable.

Practical Usage

Mainly used to add or modify the value of an existing environment variable by appending text to the current value.

Environment Variable Parameters

Property

Type

Required

Default

Markup

Description

Variable scope

Text

Yes

User

  1. TYPE="user"

  2. TYPE="machine"

  3. TYPE="process"

The scope or level belonging to the environment variable to append. The available options are:

  • User (default) - Append text to a user-level environment variable.

  • Machine - Append text to a machine-level environment variable.

  • Process - Append text to a process-level environment variable.

Environment variable

Text

Yes

(Empty)

NAME="TEMP"

The name of the environment variable to which the text will be appended. Click the down arrow to select from drop-down list of existing environment variables that correspond to the level specified under the Variable scope parameter.

Text to append

Text

Yes

(Empty)

VALUE="new text"

The text to be appended to the value of the environment variable.

Populate variable with the value

Text

Yes

(Empty)

RESULTVARIABLE="VarName"

The name of an existing variable to populate with the resulting value.

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: This sample task creates a variable named "theVar". Next, it appends text "\subtemp" to environment variable "TEMP" of type "user". Finally, a message box displays the value of the "%theVar%" (which is the value of the TEMP environment variable with the newly appended text).

<AMVARIABLE NAME="theVar"></AMVARIABLE>
<AMENVVARS ACTIVITY="append" TYPE="USER" 
NAME="TEMP" VALUE="\subtemp" RESULTVARIABLE="theVar" />
<AMSHOWDIALOG>%theVar%</AMSHOWDIALOG>