Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » Example: writeClear, writeCreate, writeDestroy, writeEx, writeLineEx

Example: writeClear, writeCreate, writeDestroy, writeEx, writeLineEx

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE
variables
{
    long mNewPage; // Sink identifier
}

on start
{
    // Create a new page at the Write Window
    mNewPage = writeCreate("New Page");

    // Configure the page so that its content is logged
    writeConfigure(mNewPage, 20, 1, "c:\\temp\\writelog.TXT");

    // Clear content of CAPL page
    writeclear(1);

    // Show the description of the program
    writeLineEx(mNewPage, 2, "This program shows the keyboard sequence in a new created Page ");
    writeLineEx(mNewPage, 4, "\nKeyboard sequence: ");
}

on key *
{
    // Show the current key at the "New Page"
    char currentKey;
    currentKey = this;
    writeEx(mNewPage, 4, "%c ", currentKey);
}

on stopMeasurement
{
    // Destroy the new created Page
    writeDestroy(mNewPage);
}