Debug command color toggling

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Debug command color toggling

Post 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!
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: Debug command color toggling

Post by Rinzwind »

How about an optional parameters that specifies the output color?
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Debug command color toggling

Post 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.
Post Reply