Text - Pad

Declaration

<AMTEXT ACTIVITY="pad_text" TEXT="text" RESULTVARIABLE="text" 
ACTION="text (options)" PADTYPE="text (options)" 
PADDINGCHAR="text" AMOUNT="number" />

Description: Adds a single character to the beginning and/or end of the specified text and places the result in a variable.

Practical Usage

Text manipulation.

General Parameters

Property

Type

Required

Default

Markup

Description

Text to pad

Text

Yes

(Empty)

TEXT="My Name is Joe"

The target text to be padded. As with every text parameter, if the data you wish to enter is contained in a variable, simply enter the variable name surrounded by percentage signs to resolve it to it's contents at runtime (e.g., %VarName%).

Action

Text (options)

No

pad_beginning

  1. ACTION="pad_beginning"

  2. ACTION="pad_end"

  3. ACTION="pad_both"

The location that the padding should be applied. The available options are:

  • Until text is specific length (default): The padding will be repeated until the text reaches a certain length.

  • A specified number of times: The padding will be repeated x number of times regardless of the text length.

Length of text

Number

Yes if Padding type is length

(Empty)

LENGTH="10"

The total length of the text in which padding should end. This parameter is available only if the Padding type parameter is set to Until text is specific length.

Number of times to add

Number

Yes if Padding type is amount

(Empty)

AMOUNT="5"

The total amount of times that the padding should be repeated. This parameter is available only if the Padding type parameter is set to A specified number of times.

Populate variable with result

Text

Yes

(Empty)

RESULTVARIABLE="varname"

The name of an existing variable to receive the new value after character insertion is performed.

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 displays a message box showing text before and after a Text - Pad activity is used.

<AMVARIABLE NAME="varname" VALUE="hello" />
<AMSHOWDIALOG WINDOWTITLE="Text before Pad activity">
%varname%</AMSHOWDIALOG>
<AMTEXT ACTIVITY="pad_text" TEXT="%varname%" 
RESULTVARIABLE="varname" ACTION="pad_end" 
PADTYPE="insert_position" PADDINGCHAR="_" 
AMOUNT="1" />
<AMSHOWDIALOG WINDOWTITLE="Text after Pad 
activity inserts a &quot;_&quot; character at the end 
of the original text.">%varname%</AMSHOWDIALOG>