I've come across a bug where a do loop seems to translate incorrectly to java and thus errors on the java compile stage. Here is a very short example that errors every time I try to compile it:
This is a 'stock' default project except for the few lines in Activity_Create. Here is the error I get:
If I remove the line -> ix = ix + 1, I get this error:
I've attached a pic of the error on my pc. Let me know if I can be of further assistance.
Jesse
ps. as you can see in the picture, I'm using B4A v1.8. I also attached the exported project.
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim mapSubs As Map
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim ix As Int
Do While True
ix = ix + 1
Loop
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
This is a 'stock' default project except for the few lines in Activity_Create. Here is the error I get:
B4X:
Compiling code. 0.00
Generating R file. 0.00
Compiling generated Java code. Error
B4A line: 17
ix = ix + 1
javac 1.6.0_26
src\com\warsoftapps\dolooptest\main.java:216: unreachable statement
;
^
1 error
If I remove the line -> ix = ix + 1, I get this error:
B4X:
Compiling code. 0.01
Generating R file. 0.00
Compiling generated Java code. Error
B4A line: 16
Do While True
javac 1.6.0_26
src\com\warsoftapps\dolooptest\main.java:214: unreachable statement
;
^
1 error
I've attached a pic of the error on my pc. Let me know if I can be of further assistance.
Jesse
ps. as you can see in the picture, I'm using B4A v1.8. I also attached the exported project.
Attachments
Last edited: