Click or drag to resize

Pad Function (Usual, Long, String)

X#
Pad character, numeric, and date values with fill characters on the right.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION Pad(
	uValue AS USUAL,
	nLength AS LONG,
	 cFillChar AS STRING
) AS STRING
Request Example View Source

Parameters

uValue
Type: Usual
A character, numeric, or date value to pad with a fill character.
nLength
Type: Long
The length of the string to return.
cFillChar
Type: String
The character with which to pad uValue.
The default is a space character.

Return Value

Type: String
A string containing uValue and padded with cFillChar to a total length of nLength.
If the length of uValue exceeds nLength, Pad() truncates cPaddedString to nLength.
Remarks
Pad() displays variable-length strings within a fixed-length area.
It can be used, for example, to ensure alignment with consecutive ?? commands.
Another use is to display text to a fixed-width screen area, ensuring that previous text is completely overwritten. Pad() is the inverse of Trim(), which trims trailing space from strings.
Examples