Page 1 of 1

Debug command color toggling

Posted: Thu Aug 11, 2022 4:18 am
by BarryG
Quite often I use the Debug command to show output of text, but they all run into each other and it's hard to see where one command output stops, and where a new one starts, especially when the output is multi-line text. Observe the following code and how the output currently appears:

Code: Select all

Debug "This is one Debug command"
Debug "This is also"+#CR$+"one Debug command, but it looks like two"
Debug "And this is a third Debug"+#CR$+"command that looks like"+#CR$+"three separate Debug commands"
Debug "Lastly, this is a final single Debug command"
Image

To clearly separate each, we currently have to either resort to using Debug with a blank line as a separator, or we can turn on Debug timestamps (but that makes the text even harder to read, and also gets in the way when you need to copy the output).

So I propose a third solution: a slight color toggle with each use of the command, so the output might appear like below. We can see at a glance where each Debug started and ended, and there's no timestamps to get in the way or get copied. You could make color-toggling an option if need be?

Color-toggling is already a feature for Procedure backgrounds in our code, so it would be nice to have it as an option for Debug text (IMO, anyway).

Image

Thanks for considering!

Re: Debug command color toggling

Posted: Thu Aug 11, 2022 5:32 am
by Rinzwind
How about an optional parameters that specifies the output color?

Re: Debug command color toggling

Posted: Thu Aug 11, 2022 6:03 am
by BarryG
That won't work, because you don't know when the command will be called (such as when it's in several threads). Each thread wouldn't know when the last use of Debug() was in the other threads, so how will they know which color to use? No, the command itself would have to take care of the toggling, with each use of it.