The FmtText procedure is a utility to format text within your program.
The FmtText procedure can create a string of text using substitution variables to format the text. Up to 32 optional substitution variable may be specified and inserted in the the message text at runtime.
szFormattedText FmtText( szMsgPattern 32740A Const Varying szSubstitutionValue1 * Value OPTIONS(*STRING : *NOPASS) szSubstitutionvaluen... * Value OPTIONS(*STRING : *NOPASS) ... up to 16 substitution values may be specified ) |
|
See also: WrtTrace |
The return value is a character value containing the formatted text with all substitutions performed.
.....C*Rn01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++++++++++
C eval ErrMsg = FmtText('Customer %s is not found.':
C %char(CustNo) )
In this example the numeric values CUSTNO ise converted to character using %CHAR and inserted into the first parameter in place of the %s substitution symbol.
If CUSTNO = 3741 the field ERRMSG would contain the following:
Customer 3741 is not found.