DebugMsg()
internally calls the TraceMsg() function if the debug switch is on. The implementation of this function can be found in DEBUG.CI in the INCLUDE project. You can turn the debug switch on or off by doing any of the following:
DebugMsgSet(INT bDebugMsg)
on the Kernel Cicode window. (Or, this function can be called from a keyboard command or something similar.)[Code]DebugMessage
parameter in the INI file.For example:
INT
FUNCTION
FilePrint(STRING sDeviceName, STRING sFileName)
INT hFile;
INT hDev;
STRING Str1;
hDev = DevOpen(sDeviceName, 0);
IF (hDev = -1) THEN
DebugMsg("Invalid arg to FilePrint - 'DeviceName'");
RETURN 261; /* File does not exist */
END
hFile = FileOpen(sFileName, "r");
IF (hFile = -1) THEN
DebugMsg("Invalid arg to FilePrint - 'FileName'");
DevClose(hDev);
RETURN 261; /* File does not exist */
END
WHILE NOT FileEof(hFile) DO
Str1 = FileReadLn(hFile);
DevWriteLn(hDev, Str1);
END
FileClose(hFile);
DevClose(hDev);
RETURN 0;
END
Published June 2018