Since it is easier to find I create an own topic here.
Code:
EnableExplicit
Macro DebugStructure(variable_, structure_)
CompilerIf #PB_Compiler_Debugger
CompilerIf Not Defined(DebugStructure_JSON, #PB_Variable)
Define DebugStructure_JSON.i
CompilerEndIf
DebugStructure_JSON = CreateJSON(#PB_Any)
If DebugStructure_JSON
InsertJSONStructure(JSONValue(DebugStructure_JSON), @variable_, structure_)
Debug ComposeJSON(DebugStructure_JSON, #PB_JSON_PrettyPrint)
FreeJSON(DebugStructure_JSON)
EndIf
CompilerEndIf
EndMacro
Structure test
a.s
b.f
c.i
d.d
e.s
f.i
EndStructure
Define t.test
t\a = "Test"
t\b = 1.1
t\c = 3
t\d = 1.2345678
t\e = "blabla"
t\f = 2
DebugStructure(t, test)