SomPrintf: Difference between revisions
Appearance
No edit summary |
mNo edit summary |
||
Line 3: | Line 3: | ||
==Syntax== | ==Syntax== | ||
string fmt; | |||
string fmt; | long rc; | ||
long rc; | |||
rc = somPrintf(fmt,· · ·); | |||
The values to be substituted into the format string. | The values to be substituted into the format string. | ||
==Parameters== | ==Parameters== | ||
; fmt (string) : The format string to be output. | ;fmt (string) : The format string to be output. | ||
==Return Code== | ==Return Code== | ||
; rc (long) : Returns the number of characters written. | ;rc (long) : Returns the number of characters written. | ||
==Remarks== | ==Remarks== | ||
This function prints a formatted string using function SOMOutCharRoutine, in the same manner as the C printf function. The implementation of SOMOutCharRoutine determines the destination of the output, while the C printf function is always directed to stdout. (The default output destination for SOMOutCharRoutine is stdout also, but this can be modified by the user.) | This function prints a formatted string using function SOMOutCharRoutine, in the same manner as the C printf function. The implementation of SOMOutCharRoutine determines the destination of the output, while the C printf function is always directed to stdout. (The default output destination for SOMOutCharRoutine is stdout also, but this can be modified by the user.) | ||
==Example Code== | ==Example Code== | ||
Line 26: | Line 25: | ||
==Related== | ==Related== | ||
;Functions | |||
* [[somVprintf]] | * [[somVprintf]] | ||
* [[somPrefixLevel]] | * [[somPrefixLevel]] | ||
Line 32: | Line 31: | ||
* [[SOMOutCharRoutine]] | * [[SOMOutCharRoutine]] | ||
[[Category:SOM | [[Category:SOM function]] |
Latest revision as of 02:27, 6 May 2020
This function prints a formatted string in the manner of the C printf function.
Syntax
string fmt; long rc; rc = somPrintf(fmt,· · ·);
The values to be substituted into the format string.
Parameters
- fmt (string)
- The format string to be output.
Return Code
- rc (long)
- Returns the number of characters written.
Remarks
This function prints a formatted string using function SOMOutCharRoutine, in the same manner as the C printf function. The implementation of SOMOutCharRoutine determines the destination of the output, while the C printf function is always directed to stdout. (The default output destination for SOMOutCharRoutine is stdout also, but this can be modified by the user.)
Example Code
#include <somcls.h> somPrintf("The class name is %s.\n", _somGetClassName(obj));
Related
- Functions