FORMAT

Previous  Next

 

string = FORMAT( "format string", arg1, arg2... )

 


 

Returns a formatted string.  The format string conforms to the C/C++ sprintf/printf format.   The FORMAT function can handle REAL, INTEGER and STRING data types.  Types such as HANDLE, REFERENCE and MODULE must first be converted to INTEGER using the INT function before it can be used in FORMAT.

 

Example:

 

DIM strLine AS STRING

 

' Format strLine for printout

strLine = FORMAT( "Kalle %s is %d days old", "Anka", 653 )

PRINT strLine,

 

' This will get the address of strLine as a HEX number

strLine = FORMAT( "Address of STRLINE = 0x%08X", INT( REF( strLine ) ) )

PRINT strLine,