Java Compile error for assigning text value...

DevBaby

Active Member
Licensed User
Longtime User
I am using the exact code format in the Beginner's guide page 44 for updating a label value based on keypad entries. However, the compiler gives the following error:


B4A line: 1719
BaLblDisplayDW.Text = BaLblDisplayDW.Text & Send.Tag

javac 1.6.0_26
src\am\game\pkg\main.java:755: unreachable statement
mostCurrent._balbldisplaydw.setText((Object)(mostCurrent._balbldisplaydw.getText()+String.valueOf(_send.getTag())));
^
1 error


The bold line is my code. "Send.Tag" is simply the string value of the tag I set on the numerical keypad (0 - 9). Send is a button type that I set = to the "sender" of the click event.

I also tried to assign the Send.Tag value to a string variable I declared and got a similar "unreachable statement" error.

Thanks or any help.
 
Last edited:

DevBaby

Active Member
Licensed User
Longtime User
Thanks.

I am not sure how the link helps, it is talking about loops...this is not the problem I am having.
 
Upvote 0

DevBaby

Active Member
Licensed User
Longtime User
See below, BaLblDisplayDW.Text is an activity view declared elsewhere. The bold line is where the error occurs.

==============================================================

Sub BaKpBtn_Click

Dim Send As Button

Send = Sender

Select Send.Tag​

Case "Back"

If BaLblDisplayDW.Text.Length > 0 Then

BaLblDisplayDW.Text = BaLblDisplayDW.Text.SubString2(0,BaLblDisplayDW.Text.Length - 1)​

End If​

Case "Cancel"​

RefreshMainPages
PnlBanking.Visible = False
ShowMainPage("Page3")
Else​


BaLblDisplayDW.Text = BaLblDisplayDW.Text & Send.Tag


End Select​

End Sub
 
Last edited:
Upvote 0
Top