Hi,
I would like to know if there is a IDE-Tool somewhere that can set a front/back color to the text added to the EditorGadget of the Debug Output window ?
I search a bit on the Purebasic github. I found some files like DebugOutput.pb and DebuggerCommon.pb where part of the interactions with this window is declared but I don't know how to change the behaviour of "Debug" keyword/macro or how to add a new macro like "DebugTextColor" before calling "Debug" to change the color of debugged text.
Debug Output Text color
Debug Output Text color
Windows 11 Pro x64
PureBasic 6.30 x64
PureBasic 6.30 x64
- Michael Vogel
- Addict

- Posts: 2860
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Debug Output Text color
Nice idea
I was dreaming to memorize the source code line number of each debug text - this would allow to show the code by hovering over the debug window or to jump directly to the line by double clicking. But: changing the code within the editor while the debug window is shown would need to update these values permanently.
I was dreaming to memorize the source code line number of each debug text - this would allow to show the code by hovering over the debug window or to jump directly to the line by double clicking. But: changing the code within the editor while the debug window is shown would need to update these values permanently.
Re: Debug Output Text color
Your idea is great too !
About my question, is this possible with an IDE-Tool or should it be included natively in PB ?
About my question, is this possible with an IDE-Tool or should it be included natively in PB ?
Windows 11 Pro x64
PureBasic 6.30 x64
PureBasic 6.30 x64
Re: Debug Output Text color
@tatanas:
I'm not sure I fully understand what you want to do.
I can share some thoughts about the windows implementation.
If you want change the color of lines, words or sections and not the entire control you could use the richtext feature of the EditorGadget.
The problem here is, that this textmode needs to activated first. see #EM_SETTEXTMODE with #TM_RICHTEXT, or similar. Default is #TM_PLAINTEXT now. This Sendmessage_() must be the first after creation. At least the Control must be empty. This was changed to the current textmode because of some error reports.
Keep in mind that the debug output can also set to shown in the error-log-control (not sure what control that is).
To make a long story short: I guess it is pretty tricky (if possible) to change this with an IDE-Tool and for the internal implementation it has to be multi-platform.....
Or maybe I'm completely wrong.
I'm not sure I fully understand what you want to do.
I can share some thoughts about the windows implementation.
If you want change the color of lines, words or sections and not the entire control you could use the richtext feature of the EditorGadget.
The problem here is, that this textmode needs to activated first. see #EM_SETTEXTMODE with #TM_RICHTEXT, or similar. Default is #TM_PLAINTEXT now. This Sendmessage_() must be the first after creation. At least the Control must be empty. This was changed to the current textmode because of some error reports.
Keep in mind that the debug output can also set to shown in the error-log-control (not sure what control that is).
To make a long story short: I guess it is pretty tricky (if possible) to change this with an IDE-Tool and for the internal implementation it has to be multi-platform.....
Or maybe I'm completely wrong.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
- Kwai chang caine
- Always Here

- Posts: 5665
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Debug Output Text color
Hello nice DuckMichael Vogel wrote: Wed Feb 04, 2026 6:45 pm I was dreaming to memorize the source code line number of each debug text
I have not really understand your dream
You want to say, if i write in the IDE, in "MyCode.pb" file
Code: Select all
122 - a$ = "I love"
123 - Debug a$ + " the'Code: Select all
10 - a$ = "Green"
11 - Debug a$ + " duck'The debugger must write a style of that ?
And like the native tool "search text in files" in actual IDE Edit menu , when you double click on each line, you go to the line 123 or 11 where is in the corresponding file pb code, on the IDE ?Debugger wrote:MyCode/123 => I love the
MyCode2/11 => Green duck
- Michael Vogel
- Addict

- Posts: 2860
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Debug Output Text color
Something like that, yes...
I know that I can do such things with #PB_Compiler_Line and #PB_Compiler_Procedure (see macro below) but it would be helpful to have such information automatically (could be shown in extra columns of a listicon gadget or only when hovering around with the mouse).
This information isn't useful in all cases but when trying to localize a bug in a larger source and adding many debug lines the debug output can be confusing, especially when just adding a simple 'Debug i' here and a 'Debug test' there.
I know that I can do such things with #PB_Compiler_Line and #PB_Compiler_Procedure (see macro below) but it would be helpful to have such information automatically (could be shown in extra columns of a listicon gadget or only when hovering around with the mouse).
This information isn't useful in all cases but when trying to localize a bug in a larger source and adding many debug lines the debug output can be confusing, especially when just adding a simple 'Debug i' here and a 'Debug test' there.
Code: Select all
Macro Debug(output)
#BirdsDebugCodeLineCharacterLength= 5
#BirdsDebugPorcedureCharacterLimit= 6
Debug LSet(#PB_Compiler_Procedure,#BirdsDebugPorcedureCharacterLimit)+"|"+RSet(Str(#PB_Compiler_Line),#BirdsDebugCodeLineCharacterLength)+" | "+output
EndMacro
Procedure loop(n)
If n>0
Debug(n)
loop(n-1)
EndIf
EndProcedure
Debug("TEST")
Debug(test)
loop(7)
Debug("All done "+test)- Kwai chang caine
- Always Here

- Posts: 5665
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Debug Output Text color
Nice your MACRO 
I never thinking to use a thing like that
Just use the #PB_Compiler_Procedure constant in my error msgbox in title for know what procedure is not happy
It's justly for this adding of all this style of really usefull temporary debug code that we must to add here, remove, add elsewhere, remove... Etc.. That i'm forcing to put my big snout into the IDE code source, at the begining for see quicly the value in the map in runtime
I never thinking to use a thing like that
Just use the #PB_Compiler_Procedure constant in my error msgbox in title for know what procedure is not happy
It's justly for this adding of all this style of really usefull temporary debug code that we must to add here, remove, add elsewhere, remove... Etc.. That i'm forcing to put my big snout into the IDE code source, at the begining for see quicly the value in the map in runtime

