H hackhack Active Member Licensed User Longtime User Jun 26, 2011 #1 I wrote B4X: Do While 1=1 Loop Expecting it to run forever - but instead I get a compilation error ("Unreachable statement") Aww, why is that?
I wrote B4X: Do While 1=1 Loop Expecting it to run forever - but instead I get a compilation error ("Unreachable statement") Aww, why is that?
agraham Expert Licensed User Longtime User Jun 26, 2011 #2 The Java compiler does not allow statically compiled infinite loops. It is complaining that the statement after the Loop statement can never be executed. You can fool it like this. B4X: Dim a As Int a = 1 Do While a=1 ' ... Loop Upvote 0
The Java compiler does not allow statically compiled infinite loops. It is complaining that the statement after the Loop statement can never be executed. You can fool it like this. B4X: Dim a As Int a = 1 Do While a=1 ' ... Loop
H hackhack Active Member Licensed User Longtime User Jun 26, 2011 #3 I know how to fool it, i just wondered why it did that. Upvote 0
agraham Expert Licensed User Longtime User Jun 26, 2011 #4 hackhack said: I know how to fool it Click to expand... Well clever old you, but I thought that I would tell you (and anyone else interested) anyway. Upvote 0
hackhack said: I know how to fool it Click to expand... Well clever old you, but I thought that I would tell you (and anyone else interested) anyway.