Consultor Eletrônico



Kbase P185632: Can characters such as "Z" or "X" be used in a format string as literals?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/4/2011
Status: Unverified

GOAL:

Can characters such as "Z" or "X" be used in a format string as literals?

GOAL:

How to display characters as literals in a format when they already have meaning as format symbols

FACT(s) (Environment):

All Supported Operating Systems
Progress/OpenEdge Product Family

FIX:

Characters such as "Z" or "X" cannot be used as literals in a format string, because they are already recognized as symbols (for example, "Z" represents a digit which should be replaced by a blank if it is a leading zero). These characters cannot be escaped in any way within a format specification.
To work around this restriction, use the STRING function to convert the field or variable to a string, using a format without the desired literal characters. Then concatenate the literal characters to the formatted string, and display the combined string using a character format ("X(n)"). For example:
'ZAR' + STRING(CreditLimit, '>>,>>9.99') FORMAT 'X(12)'