Environment Variables - Append

Declaration

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

Related Topics   

Description

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

NOTE: 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.

Parameters

environment variable

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 AutoMate variable in which to populate with the resulting value.

 

Description

Error Causes

On Error

example

NOTE: 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>