You are here: Function Reference > Alphabetical Listing > J > JLeft

JLeft

Use this function to left justify text within a specified length and return the result.

Syntax

JLeft (String, Length)

Parameter

Description

String

Enter a valid string. The default is the value of the current field.

Length

Specify the desired length of output. The default is the length of the input string.

The system left justifies the text characters of the string parameter within the specified length and returns the new string.

If the length specified in the length parameter is longer than the string, the result will be increased to the given length before the justification. If the length specified is less than the string, the length of the string is used.

Example

Here are some examples:

(Assume the current field contains the text Name and can be up to 20 characters.)

Function

Result

Explanation

JLeft

("Heading", 20)

"Heading
"

Left justifies the text within a length of 20 spaces.

JLeft
(" Complete blanks. ", 5)

"Complete blanks. "

Ignores the specified length (5) because it is less than the given string.

JLeft ( , Size ( ) & "X")

"Name

X"

First the Size function determines that the maximum length of the field is 20. Then X is added to the end of the field. There are 15 spaces between the end of the word Name and the X.

See also