Instructions
349 C-Control Pro IDE
© 2013 Conrad Electronic
5.24.6 Str_Len
String Functions
Syntax
word Str_Len(char str[]);
Sub Str_Len(ByRef str As Char) As Word
Description
The length of the string (character array) is returned.
Parameter
str pointer to string
Return Parameter
length of the string (without terminating zero)
5.24.7 Str_Printf
String Functions Example
Syntax
void Str_Printf(char str[], char format[], ...);
Sub Str_Printf(ByRef str As Char, ByRef format As Char, ...)
Description
This function creates a formatted string into str. The format string is similar to the formatting of printf() in C.
The format always begins with "%", then follow optional flags (0,l), and it ends with a type (d,x,s,f). In the
following table all type parameters are explained. Between % and type an optional width and precision
can be used.
%[flags][width][.prec]Typ (the brackets describes the optional part)
The width is the minimal space for the output of the number. If the number is smaller than width, the num-
ber is padded to the left with spaces. If the width begins with "0" the left is padded width "0" instead of
spaces. A period "." describes an optional precision parameter, that defines the number of decimal
places, when floating point numbers (%f) are used, or the base of the number when using unsigned in-
teger (%u). See Str_Printf Example.
If there is no "l" flag when a 32-Bit number is printed, only the lower 16 bits are displayed.
Flags
Description