Pad Text Action

Declaration

<AMTEXTPAD ACTION="text [options]" TEXT="text" PADDINGCHAR="text" PADTYPE="text [options]" AMOUNT="text" RESULTVARIABLE="text [variable name]">

See Also

Pad Text Action-Setting Properties, Find Text Action, Get Subtext Action, Trim Text Action, Replace Text Action

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.

Parameters

General Tab

Text to Pad

Text, Required
MARKUP: TEXT="My Name is Joe"

Specifies target text to be padded.  

Pad

text [options], Optional Default is pad_beginning
MARKUP: ACTION="pad_end"

Specifies the location of that the padding should be applied.

The available options are:

Character to pad with

Text, Required
MARKUP: PADDINGCHAR=" "

Specifies text to use as the padding character.  

Padding type

text [options], Optional Default is length
MARKUP: PADTYPE="amount"

Specifies the location of that the padding should be applied.

The available options are:

Length of text

Number, Required if PADTYPE is length
MARKUP: LENGTH="10"

Specifies text the length that the text should be padded to.

Populate Variable with Result

Text [variable name], Required
MARKUP: RESULTVARIABLE="varname"

Specifies the variable to receive the new value.

Notes

Using Variables

All variables must be created before they can be used. This is done using the Create Variable <AMVARIABLE> action. Once created, variables can be set using the Set Variable <AMSET> action, or by certain actions that support populating variables. To get data out of the variables, in any action parameter, simply surround the variable name with percentage % signs (e.g. %varname%). Remember not to use percentage signs when specifying the name of a variable to populate, percentage signs are only needed to get data out.

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMVARIABLE NAME="varname">hello</AMVARIABLE>
<AMTEXTPAD ACTION="pad_end" TEXT="Hello" PADDINGCHAR="_" LENGTH="10" RESULTVARIABLE="varname">
<AMMESSAGEBOX>%varname%</AMMESSAGEBOX>