Forum Discussion

AnilSandiri's avatar
AnilSandiri
New Member
3 hours ago

Change attributes on the current Folder in the log

I am trying to change the attributes on a folder based on if there are any error messages within that folder. I was wondering if this was possible.



[code]

var goodAttr = Log.CreateNewAttributes();

goodAttr.Bold = true;
goodAttr.BackColor = clLime;
goodAttr.FontColor = clGreen;

 

var badAttr = Log.CreateNewAttributes();

badAttr .Bold = true;
badAttr .BackColor = clRed;
badAttr .FontColor = clMaroon;

 

foo = function()

{

    var previousErrs = Log.ErrCount;

 

    var logFolder = Log.CreateFolder("New Folder", "Stuff that goes in this folder", pmNormal, goodAttr);
    Log.PushLogFolder(logFolder);

 

 

    // ...

    // Do Stuff

    // Some of which may be errors

    //...

 

    if (Log.ErrCount > previousErrs)

    {

        // This is the part I can't figure out.

        Log.Item(logFolder).Attr = BadAttr;

    }

    Log.PopLogFolder();

}

[/code]

No RepliesBe the first to reply