okoc_out_msg

 

Description

Origin's general message output function

Syntax

int okoc_out_msg( LPCSTR lpcsz, char cMsgType = 'E', BOOL bAddCRLF = true )

Parameters

lpcsz
[input] the string to print. If lpcsz is NULL, it only tests current output setting which is one of the values from the enumeration below
enum {
        OUTMSG_NONE,
        OUTMSG_CMD_OUT,  // current command prompt output, can be Command Window or Script Window
        OUTMSG_CMD_OUT_OPEN_SCRIPT_WIN, // if no current command prompt output, will open Script Window
        OUTMSG_CB_CMD_OUT,                // CodeBuilder command output
        OUTMSG_CB_COMPILER_OUT,   

        OUTMSG_SCRIPT_WIN,              // classic script window regardless of current command prompt
        OUTMSG_SCRIPT_WIN_FORCE_OPEN,
};
cMsgType
[input]
'W' for warning message, controlled by Labtalk system variable @NOW, default = 2(OUTMSG_CMD_OUT_OPEN_SCRIPT_WIN)
'I' for info message, controlled by Labtalk system variable @NOI, default = 6(OUTMSG_SCRIPT_WIN_FORCE_OPEN)
'E' for error message, controlled by Labtalk system variable @NOE, default = 6(OUTMSG_SCRIPT_WIN_FORCE_OPEN)
'R' for result message, controlled by Labtalk system variable @NOR, default = 2(OUTMSG_CMD_OUT_OPEN_SCRIPT_WIN)
'D' for debug message, controlled by Labtalk system variable @NOD, default = 3(OUTMSG_CB_CMD_OUT)
Type @NOE= in script window to get the value; type @NOE=2 in script window to change the value.
bAddCRLF
[input] continue adding to the same line if FALSE, otherwise adding to a new line.

Return

return OUTMSG_NONE if that type of msg output has been turned off

Examples

EX1

#include <okocUtils.h >
void okoc_out_msg_ex1()
{
    string strMsg = "Error! Please check your input data.";
    int nRet = okoc_out_msg(strMsg, 'E', true);    
    out_int("output window type = ", nRet);  

    // "Error! Please check your input data." output in script window, 
    // and in default case, the output window type should be 6.    
}

Remark

See Also

header to Include

okocUtils.h

Reference