Pad

See Also: String Functions, Append, Center, Left, Length, Trim

Purpose

Pad returns a string of specified length with spaces added to, or characters truncated from, the right of the input string as necessary.

Return Type

String

Syntax

(Pad( {string-value}, {length} ))

Where:

What It Does

Pad adds spaces to the right of {string-value} until the length of the string is equal to {length}.

Procedure Test

    String sFirstName sLastName

 

    Move "John"  To sFirstName

    Move "Smith" To sLastName

    Showln (Pad(sFirstName, 10))  sLastName

End_Procedure

In the above example the string "John······Smith" would be shown, where · represents a space character.

Notes