Variable not allowed?

jroot66

New Member
Licensed User
Longtime User
I am new to B4A so I may be missing something.
I have tried to dimension the word "Board" as Map but keep getting the
java.lang.RuntimeException: Field board was declared with the wrong type.

I've searched the Java, and B4A reserved words and have not found it listed.
If I try "Dim Boardx As Map" I have no problem. A bug in Java or B4A or just an anomaly?
 

jroot66

New Member
Licensed User
Longtime User
RE: Variable problem

Thank you for a quick reply
I found the problem. I had used Designer to create a panel named "Board" and tried to give a Map collection the same name in code. I think its better to create the elements in code rather than Designer as you have a clearer handle on things.
 

klaus

Expert
Licensed User
Longtime User
I think its better to create the elements in code rather than Designer as you have a clearer handle on things.
No, not sure.
I have taken the habit to put a prefix for all views like pnl for Panael, lbl for Label etc so you know what you are handling.

Best regards.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…