Function that performs formatting of a string based on the description provided by the user.
Syntax |
i32 str_format (string buff, desc [, val1, val2, val3, ...]) |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buff |
Variable containing the formatted string |
||||||||||||||
desc |
String constant containing the description of the format to be used during buff composition. NOTE: Refer to the description of the C (ANSI standard) sprintf function for details and the formalism that can be used.
|
||||||||||||||
val1, val2, val3, ... |
Optional parameters, consisting of generic integer, real, or string expressions. Must match exactly the formalism and number of parameters in the string desc |
||||||||||||||
Result |
Returns the number of bytes written in the buff string |
||||||||||||||
Validity |
Rule, Task |
||||||||||||||
Note |
It is the responsibility of the user to correctly match, in number and type, the optional parameters passed to the str_format() function. It must also be ensured that the formatting of the buff string does not require writing more characters than the declared size. The compiler is unable to identify and report any inconsistencies. This function should therefore be used with special warning, as it may cause system crashes or other runtime malfunctions |
Example of use:
|