Android Question Problem with type containing an array

QuentinLindh

Member
Licensed User
Longtime User
Hi I am new to b4a, comming from C. I found this example of a type definition:
http://www.b4x.com/android/forum/threads/multi-dimension-arrays-arraylist-or-list.17528/
I took that and added an array of ints with the type definition:

Type pumptype(times(28) As Int, duration As Int, active As Boolean)
Dim pumpdata(4) As pumptype
then I refer to a specific time with the following
pumpdata(0).times(1)=something
It compiles, runs then crashes out with a "javalang NULL pointer"
Am I overstepping the type functionality in some way?
Thanks,
Quentin
 

QuentinLindh

Member
Licensed User
Longtime User
I tried separating
Dim Pumpdata1 As pumptype
Dim Pumpdata2 As pumptype
etc..
same error
I guess it comes down to the question are arrays allowed inside of a type?
Thanks,
Quentin
 
Upvote 0
Top