List of expression elements / Character string operators |
The SFMT() operator replaces place holders in a string with values.
SFMT( str-expr , param [ , param [...] ])
The SFMT() operator can be used with parameters that will be automatically set in the string at the position defined by parameter placeholders. The parameters used with the SFMT() operator can be any valid expressions. Numeric and date/time expressions are evaluated to strings according to the current format settings (DBDATE, DBMONEY).
A placeholder a is special marker in the string, that is defined by the percent character followed by the parameter number. For example, %4 represents the parameter #4. You are allowed to use the same parameter placeholder several times in the string. If you want to use the percent sign in the string, you must escape it with %%.
Predefined placeholders can be used to insert information about last runtime system error that occurred. Note that these are only available in the context of a runtime error trapped with a WHENEVER ERROR GOTO / CALL handler:
Predefined parameter | Description |
---|---|
%(ERRORFILE) | Name of the module where last runtime error occurred. |
%(ERRORLINE) | Line number in the module where last runtime error occurred. |
%(ERRNO) | Last operating system error number. |
%(STRERROR) | Last operating system error text. |
MAIN DEFINE n INTEGER LET n = 234 DISPLAY SFMT("Order #%1 has been %2.",n,"deleted") END MAIN