Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » write

write

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

void write(char format[], ...);

Description

Outputs a text message to the Write Window. Write is based on the C function printf. The compiler cannot check the format string. Illegal format entries will lead to undefined results. Messages output with the write function will be displayed on separate lines.

Parameters

Format string, variables or expressions

Return Values

Example

Examples:
float f=123.456;
on key 'h'
{
   write("Hello World!");
   write("f = %5.3f",f);
   write("format is not supported for the given variable");
   write("f = %7.3f",f);
   write("f = %9.3f",f);
}
on key 'q'
{
   qword q = 0x1234567890ABCDEFLL;
   write("Decimal: %I64u", q);
   write("Hexadecimal: %I64X", q);
}
on key 'd'
{
   dword d = 0x1234;
   write("Decimal: %u", d);
   write("Hexadecimal: %X", d);
}
snprintfwriteToLogwriteToLogEx