FMTDP function

Syntax

FMTDP (expression, format [ , mapname ] )

Description

In NLS mode, use the FMTDP function to format data for output in display positions rather than character lengths.

expression evaluates to the numeric or string value to be formatted. Any characters that cannot be mapped in expression are assumed to have a display length of 1.

format is an expression that evaluates to a string of formatting codes. The syntax of the format expression is:

[width] [fill] justification [edit] [mask]

The format expression specifies the width of the output field, the placement of background or fill characters, line justification, editing specifications, and format masking. For complete syntax details, see the FMT function.

If format has a display length greater than 1, and there is only one display position left to fill, FMTDP enters the extra fill character. The returned string can occupy more display positions than you intended.

mapname is the name of an installed map. If mapname is not installed, the display positions of the characters in expression are used. If any characters that cannot be mapped exist in expression, the display length is 1, that is, the unmapped character displays as a single character that cannot be mapped. If mapname is omitted, the map associated with the channel activated by the PRINTER statement ON statement is used; otherwise, the map associated with the terminal channel (or print channel 0) is used.

You can also specify mapname as CRT, AUX, LPTR, and OS. These use the maps associated with the terminal, auxiliary printer, print channel 0, or the operating system, respectively. If you specify mapname as NONE, the string is not mapped.

If you execute FMTDP when NLS is disabled, the behavior is the same as for FMT.