XenoGuard 4.0 Documentation

Pad Left

ActionStep Reference » Programming » String Operation » Addendum » Pad Left 

The ActionStep Pad Left inserts a character from the left of a specified string based on a specified total length and stores the new string in Result of the result list.

[-] Hide
  1. Open the Programming node in the Workspace Explorer.
  2. Open the String Operation node.
  3. In the Addendum node, select the Pad Left ActionStep.

Parameters:

The ActionStep has the following input parameters:


NAME DESCRIPTION
String The string to be padded from the left.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Pad Char
A character to be inserted from the left.

Allowed Context Scopes
 [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Total Length
The number of characters to be inserted from the left including the length of the String parameter.

Allowed Context Scopes
 [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]

Results:

The ActionStep returns the following results:


name
description
Result Contains the new string.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter]

Warning

An exception occurs when the value of the Total Length parameter is a negative number or the Pad Char is empty.

Information The Result will return the original string value if the Total Length parameter is less than or equal to the length of the String parameter.

Example 1 (Adds five leading zeros to a variable):

This example inserts five leading zeros to the string of the local Invoice Number variable with Text as data type. The result of the new string is then output via Write Text.

See other Addendum operations:

Insertion
Concatenation
Replace
Pad Right