Bagikan melalui


PADL( ) | PADR( ) | PADC( ) Functions

Returns a string from an expression, padded with spaces or characters to a specified length on the left or right sides, or both.

PADL(eExpression, nResultSize [, cPadCharacter])

-Or-

PADR(eExpression, nResultSize [, cPadCharacter])

-Or-

PADC(eExpression, nResultSize [, cPadCharacter])

Return Values

Character

Parameters

  • eExpression
    Specifies the expression to be padded. This expression can be any expression type except a logical or currency expression or a general or picture field.

  • nResultSize
    Specifies the total number of characters in the expression after it is padded.

  • cPadCharacter
    Specifies the value to use for padding. This value is repeated as necessary to pad the expression to the specified number of characters.

    If you omit cPadCharacter, spaces (ASCII character 32) are used for padding.

Remarks

PADL( ) inserts padding on the left, PADR( ) inserts padding on the right, and PADC( ) inserts padding on both sides.

Example

STORE 'TITLE' TO gcString
CLEAR
? PADL(gcString, 40, '=')
? PADR(gcString, 40, '=')
? PADC(gcString, 40, '=')

See Also

ALLTRIM( ) | LEFT( ) | LTRIM( ) | RIGHT( ) | STUFF( ) | TRIM( )