this is the code, a very simple map, each value is a type
the log output is:
B4X:
Sub Process_Globals
Dim mp As Map
Type tp(a As String,z As String)
End Sub
Sub AppStart (Form1 As Form, Args() As String)
mp.Initialize
Dim t As tp
t.Initialize
t.a="aaa"
t.z="AAA"
mp.Put(1,t)
Dim t As tp
t.Initialize
t.a="bbb"
t.z="BBB"
mp.Put(2,t)
Dim t As tp
t.Initialize
t.a="ccc"
t.z="CCC"
mp.Put(3,t)
Dim js As JSONGenerator
Dim s As String
js.Initialize(mp)
s=js.ToPrettyString(3)
Log(s)
Dim msg As Msgboxes
msg.Show("done","")
End Sub
the log output is:
B4X:
Program started.
{
"1": "[IsInitialized=true, a=aaa, z=AAA\n]",
"2": "[IsInitialized=true, a=bbb, z=BBB\n]",
"3": "[IsInitialized=true, a=ccc, z=CCC\n]"
}
Why the Isinitialize appears, and how to get rid of it?
Why the "\n" and how to get rid of it?