CFile:Printf
The Printf method writes formatted output to the file wrapped by this CFile object. This method provides functionality like the fprintf function in the C language.
bSuccess = CFile:Printf( sFmt, ... ) where |
sFmt is a format string.
... refers to an optional variable argument list.
bSuccess is the returned success code. On success it is true, otherwise false.
Printf takes 1 or more arguments. The first argument is a string that may be either the value to print or a format to be used for interpreting any additional arguments. Additional arguments provide values for the % fields embedded in the format string. The syntax of this function is compatible with the fprintf function in C; for details about specifying the format string, refer to documentation for fprintf or printf in the C or C++ language.
Suppose a CFile named F exists and the file is open for writing. The script below writes formatted text to the file using the Printf method:
|
|
|
-- do formatted print to the file |
|
-- make sure the data are in the file |