Lello1964 Well-Known Member Licensed User Longtime User Dec 21, 2020 #1 Hi, I have a bidimensional array : B4X: Copy dim Lista(10,10) as double how do i convert it to json?
Erel B4X founder Staff member Licensed User Longtime User Dec 21, 2020 #2 It depends on your use case. What are you using the json string for? Json supports lists and maps. Upvote 0
Lello1964 Well-Known Member Licensed User Longtime User Dec 21, 2020 #3 I must send via tcpip Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 21, 2020 #4 To a B4X app? Use B4XSerializator. In both cases, serializator or json, you will need to convert the array to something else and then back to an array. Might be better to switch to a different collection. Arrays are quite limited. Code: Copy Dim Rows As List Rows.Initialize For r = 0 to 9 Dim cols As List cols.Initialize Rows.Add(cols) For c = 0 to 9 cols.Add(Lista(r, c)) Next Next Now you should serialize Rows. Upvote 0
To a B4X app? Use B4XSerializator. In both cases, serializator or json, you will need to convert the array to something else and then back to an array. Might be better to switch to a different collection. Arrays are quite limited. Code: Copy Dim Rows As List Rows.Initialize For r = 0 to 9 Dim cols As List cols.Initialize Rows.Add(cols) For c = 0 to 9 cols.Add(Lista(r, c)) Next Next Now you should serialize Rows.