B4J Question arrays in a type definition

MbedAndroid

Well-Known Member
Licensed User
Longtime User
i'm facing something with b4j
when i define a type for example type mytype(a(64) as int, b(64) as int)
next i define a global
dim new as mytype

in the code i do new.a(3)=14 the program crashes ...with nullpointer exeption .. why?
b4j accepts the array in the type, no errors given but i cant write into it
 

MbedAndroid

Well-Known Member
Licensed User
Longtime User
just checked the code
the global is initialized, but it might be the problem that the type i defined contains many things, not only the arrays

in fact what i do is for example: type new(a as int, b as int, c(64) as int, d as float etc
 
Last edited:
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
yes i noticed this already copying the type to a new project
something else is causing this problem

edit: found it, somewhere in the startup i was reading the global back with saved data, and the data wasnt updated to the new type... stupid me, forget the save the new format
 
Upvote 0
Top