Dear all,
I am executing the Second Program from B4A Beginners Guide V3.0 after entering the code on page 53. When I compile and execute the program I get the error that says,
"java.lang.RuntimeExceptions: Object should first be initialized (Label). The screen shot of the same error is attached to this post.
Apart from that I also get a warning message as shown below:
I've few questions based on this warning.
1. How and where do I initialize a variable in my code? In my code this is what I have under Sub Globals and there is a wavy line under Private lblResult As Label. I guess there is some thing wrong with this line. Please explain what is wrong here.
Sub Globals
Public Number1, Number2 As Int
Private lblResult As Label
Private lblComments As Label
Private lblMathSign As Label
Private lblNumber1 As Label
Private lblNumber2 As Label
Private btnAction, btn0 As Button
End Sub Globals
2. Same doubt from btn0 also. How do I initialize btn0?
3. With respect to the warning Sub 'CheckResult1' is not used. I understand I've not used it any where but I renamed CheckREsult to CheckResult1 as when I was compiling the code I got an error message that duplicate value of CheckResult. Hence I renamed the second CheckResult to CheckResult1 and then it got executed successfully.
Please help me by answering my queries.
Thank you.
Regards,
Pavan Krishnaa