Is there any way to increase the number of lines displayed in the Trace Window?
I like to write programs that have elaborate log files that log every phase of the algorithm during execution. The trace window works perfectly for that.
Is there any way that the contents of the trace window could be dumped into a text file?
Thanks
Tom
Trace Window Usage
Re: Trace Window Usage
Not directly.MrCreosote wrote:Is there any way that the contents of the trace window could be dumped into a text file?
But how about this: Open a txt file on your own using the normal file class of the scripting language.
Then write a function called 'MyTrace(const string &in message) ' that does both, call the function 'Trace' to put the contents in the trace window and that writes the string to the file.
Could look something like this (the following lines are not compiled code, they are just written from the top of my head):
Code: Select all
file logFile; // The log file object of the script
void MyTrace(const string&in message)
{
Trace(message + "\r\n"); // Write content to the trace window
// Now write the same message line to the log file. 'logFile' must be an object of class 'file' that has been opened in txt mode.
if (!logFile.Write(message + "\r\n"))
{
Trace("Can't write to log file!\r\n");
}
}
void main()
{
if (!logFile.Open("SomeFile.txt", FILE_MODE_CREATE | FILE_SHARE_DENY_NONE))
{
MessageBox("Unable to open log file");
}
MyTrace("This is an example text that will end up both in the Trace Window and in the log file");
}
Thomas Jetter