ANYFORMAT

Purpose:

Produces a formatted output string. Use the more flexible SPRINTF function.

Syntax:

ANYFORMAT("control", val1, val2, val3)

"control"

-

Format control string. Conforms to C/C++ language sprintf specifications. Control strings may contain ordinary characters, escape sequences, and format specifications. The ordinary characters are copied to the output string in order of their appearance. Escape sequences are introduced by a backslash (\). Format specifications in the control string are introduced by a percent sign (%), and are matched to the specified arguments in order. If there are more arguments than there are format specifications, the extra arguments are ignored. See SPRINTF for details.

valN

-

3 scalar or string values that match the control string.

Returns:

A string.

Example:

anyformat( "Max: %f (%s %s)", max, getdate, gettime)

 

returns a string such as "Max: 32.7 (05/19/94 12:00.37)"

Remarks:

ANYFORMAT is a constrained version of SPRINTF. The SPRINTF function allows more formatting flexibility.

See Also:

NFORMAT

SFORMAT

SPRINTF