Description
Formats data in a specified pattern. The pattern can include field width, background fill characters, line justification, conversion specifications, and masking.
Syntax
output = Fmt (string, format)
Parameters
The Fmt function has the following parameters.
Parameter | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
String | Any character string to format on output. | ||||||||||||||||||
Format | An argument for format might be structured as follows. justification[(fill_char)]mask justification[(fill_char)]#[field_size] conversion Note: The # character is essential, if you are going to specify field size. Justification All formats must specify one of the following justifications.
|
FMT is identical to OConv().
Example
The following examples show how to use Fmt for format report output.
Example Output
Fmt("12345","L#6") "12345 " Fmt("12345","R(*)#8") "***12345" Fmt("ABCDEFG","R#4") "DEFG" Fmt('ABCD','C#6') " ABCD " Fmt(6666,"D2-") "04-01-86" Fmt("1234567890","L(###)###-####") "(123)456-7890"