Q QuentinLindh Member Licensed User Longtime User Oct 21, 2014 #1 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
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
thedesolatesoul Expert Licensed User Longtime User Oct 22, 2014 #2 you just need to initialize each pumptype Upvote 0
Q QuentinLindh Member Licensed User Longtime User Oct 22, 2014 #3 Thanks for the quick reply, Initialize in what way? Quentin Upvote 0
Q QuentinLindh Member Licensed User Longtime User Oct 22, 2014 #4 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
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
Q QuentinLindh Member Licensed User Longtime User Oct 29, 2014 #6 thanks, it all works great now.. Upvote 0