Platform Package reference: Function EwPrint()

Description of the function EwPrint() available in Platform Packages for C compatible target systems. This function is intended to be used when integrating the Embedded Wizard created GUI application with the underlying graphics subsystem, graphics hardware or other external GUI applications coexisting on the same system.

Declaration

void EwPrint( const char* aFormat, ... )

Parameters

aFormat

Zero-terminated string containing the message and the below explained escape sequences.

Discussion

The function EwPrint() prints formatted output to the debug console. This function works similary to the ANSI 'C' printf() function. However, only the escape sequences %d, %u, %p, %f, %s, %X, %x, %c are guaranteed to be supported. Note further limitations explained below.

The escape sequences %d, %u, %X, %x can be prefixed by a sign and number specifying the desired length of the resulting string according to the syntax %[+][0][len]{d|u|X|x}. To format 64-bit operands, prefix the escape sequence by the double ll sign, e.g.: %lld, %llu, %llX, %llx.

The escape sequence %f can be prefixed by a sign, the number specifying the desired length of the resulting string and a second number for the count of digits following the decimal sign according to the syntax %[+][0][len][.prec]f.

For the escape sequence %s it is possible to specify the desired length to fill with space signs as well as the max. width when to truncate the string. %[len][.max-len]s. If the sequence starts with - (minus) sign, the text is left aligned: %-[len][.max-len]s.

Instead of specifying [len], [prec] and [max-len] as literals within the string, it is possible to use the * (asterix) sign as instruction to get the corresponding value from the arguments following aFormat. For example: %+0*.*f.

Besides the above explained escape sequences known from printf(), the function also supports following two less common escape sequences:

%S - works similar to %s with the difference that the operand affected by the operation is assumed to be a 16-bit zero terminated string. The escape sequence permits you to print contents of Embedded Wizard own XString strings. A conversion to ANSI string is not necessary.

%C - works similar to %c with the difference that the operand affected by the operation is assumed to be a 16-bit character code. The escape sequence permits you to print contents of Embedded Wizard own XChar values. A conversion to ANSI character code is not necessary.