Page 1 of 1
Debug command - Show all characters
Posted: Sat Jan 04, 2025 10:56 am
by BarryG
Per my issue here ->
viewtopic.php?p=633226#p633226
When you copy text from that Properties dialog, using the Debug command WON'T show the invisible leading character:
Code: Select all
Debug GetClipboardText() ; Doesn't show the invisible leading character :(
It appears the Debug command only shows certain characters. Maybe it can be changed (or optional) to show all characters, or even just Chr(183) for characters that are non-visible? That would make it easier to see what we're actually debugging.

Re: Debug command - Show all characters
Posted: Sat Jan 04, 2025 8:31 pm
by DarkDragon
As I already mentioned it is specific to the font used and not all characters will be visible at all, imagine zero width space or non blocking space or anything like that.
Re: Debug command - Show all characters
Posted: Sun Jan 05, 2025 12:41 am
by BarryG
DarkDragon wrote: Sat Jan 04, 2025 8:31 pmAs I already mentioned it is specific to the font used
Changing the debug output font to different ones was something I tried before making this request. None showed the invisible leading character. Can you recommend a font that does?
Re: Debug command - Show all characters
Posted: Sun Jan 05, 2025 6:17 am
by DarkDragon
BarryG wrote: Sun Jan 05, 2025 12:41 am
DarkDragon wrote: Sat Jan 04, 2025 8:31 pmAs I already mentioned it is specific to the font used
Changing the debug output font to different ones was something I tried before making this request. None showed the invisible leading character. Can you recommend a font that does?
There are characters which are always invisible. You could create your own font with every character as visible one, but it's not easy, as you have to map every single character to a pictogram:
https://www.unicode.org/versions/stats/ ... v16_0.html
Re: Debug command - Show all characters
Posted: Sun Jan 05, 2025 8:20 am
by PBJim
I'm working on a network client bug at the moment and using Debug to see the data, often containing corrupted strings.
I think we have to accept though, that the Debug output window respects the font choice in effect, in other words it should render the output according to the font. For general testing purposes, it's helpful that debug renders output to match the way in which we'd expect it to appear within gadgets. For instance, we'd expect an LF to do exactly that — a line feed — and not to show a special symbol instead.
The above should not show A█B but rather :
A
B
The Debug window is not like the ShowMemoryViewer which contains options for displaying values as HEX. For stubborn problems, like you've shown, Barry, I would use a For/Next and do an Asc() on each character, to see the contents. I wouldn't like to see something as important as the debug output window slowed down by a conversion to symbols. So have to give a -1 on this, apologies.

Re: Debug command - Show all characters
Posted: Sun Jan 05, 2025 8:58 am
by BarryG
PBJim wrote: Sun Jan 05, 2025 8:20 amI wouldn't like to see something as important as the debug output window slowed down by a conversion to symbols.
True, which is why I said optional.

Or maybe even a new "DeepDebug" type of command could be done, which For/Nexts each char in the string.
Re: Debug command - Show all characters
Posted: Sun Jan 05, 2025 9:11 am
by PBJim
I don't know if this works well for these kinds of cases Barry. I'm sure you've considered it, but the three string view options in the memory viewer seem very good as they show the character names, in this case [LF].
Code: Select all
teststr.s = "A" + Chr(10) + "B"
ShowMemoryViewer(@teststr.s, 10)
Re: Debug command - Show all characters
Posted: Sun Jan 05, 2025 10:22 am
by Michael Vogel
As already shown, such things can be done by your own easily - and so you are able to control the output format as you like.
Anyhow every enhancement for the debug window would be nice indeed (e.g. adding the line number of the source code which triggered the output)
Code: Select all
#DumpWidth=8
Procedure DebugMemory(*mem.Ascii,len)
Protected.i b,n
Protected.s s,t
s=RSet(Hex(n),4,"0")
While n<len
s+" "+RSet(Hex(*mem\a),2,"0")
If *mem\a<32
t+"."
Else
t+Chr(*mem\a)
EndIf
b+1
n+1
If b=#DumpWidth
b=0
Debug s+" | "+t
s=RSet(Hex(n),4,"0")
t=""
EndIf
*mem+1
Wend
If b
Debug s+Space((#DumpWidth-b)*3)+" | "+t
EndIf
EndProcedure
Procedure DebugString(*string)
DebugMemory(*string,MemoryStringLength(*string,#PB_ByteLength))
EndProcedure
Procedure DebugClipboardText()
Protected s.s
s=GetClipboardText()
DebugString(@s)
EndProcedure
;SetClipboardText("Hello Barry!")
DebugClipboardText()