Jump to content

SomPrintf: Difference between revisions

From EDM2
Created page with "This function prints a formatted string in the manner of the C printf function. ==Syntax== <PRE> string fmt; long rc; rc = somPrintf(fmt,· · ·); </PRE> The values..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:somPrintf}}
This function prints a formatted string in the manner of the C printf function.
This function prints a formatted string in the manner of the C printf function.


==Syntax==
==Syntax==
<PRE>
string    fmt;
string    fmt;
long      rc;
long      rc;
rc = somPrintf(fmt,· · ·);


rc = somPrintf(fmt,· · ·);
</PRE>
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 25: Line 25:


==Related==
==Related==
===Functions===
;Functions
* somVprintf  
* [[somVprintf]]
* somPrefixLevel  
* [[somPrefixLevel]]
* somLPrintf  
* [[somLPrintf]]
* SOMOutCharRoutin
* [[SOMOutCharRoutine]]


[[Category:SOM Kernel]]
[[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