Android Question data type of 3 dimensions

peacemaker

Expert
Licensed User
Longtime User
HI, All

Who how uses such structure, if you need to operate with array of 3-dimensional objects ?
id, readable name, value.
Map is only 2-dimensional.

List of maps... complicated, in whole...
No simpler solution ?
 

LucaMs

Expert
Licensed User
Longtime User
array of 3-dimensional objects
Dim MyObjects(5,5,5) As Object


Type tSomething(id As Int, Name As String, Value As Double)
Dim lstSomehting As List
lstSomething.Inititialize
Dim Something As tSomething
Something.Initialize
Something.ID = 1
...
lstSomething.Add(Something)


Often the better way is to use a DB table (not complicated but you have to know a little stuff about DB)
 
Upvote 0

eurojam

Well-Known Member
Licensed User
Longtime User
you can define your own type like:
B4X:
Type my3D (x As Double, y As Double, z As Double)
and then building instances of it:
B4X:
    Dim p1 As my3D
    p1.Initialize
    p1.x=1
    p1.y=2
    p1.z=100   
    
    Log(p1)
 
Upvote 0
Top