amorosik Expert Licensed User Oct 14, 2020 #1 Do Until Procedure: Do Until False Log(DateTime.Now & " Hello world!!!") Loop The above code run correctly on B4A Not run on B4J, the error is B4X: B4J Versione: 8.50 Java Versione: 8 Analisi del Codice. (0.00s) Building folders structure. (0.01s) Compilazione del codice. (0.00s) Compilazione del codice di layouts (0.00s) Organizzazione Librerie. (0.00s) Compilazione del codice Java prodotto. Error B4J line: 13 Log(\ javac 1.8.0_241 src\b4j\example\main.java:64: error: unreachable statement ; ^ 1 error Line 13 is the Log(DateTime.Now & " Hello world!!!") Where is the error?
Do Until Procedure: Do Until False Log(DateTime.Now & " Hello world!!!") Loop The above code run correctly on B4A Not run on B4J, the error is B4X: B4J Versione: 8.50 Java Versione: 8 Analisi del Codice. (0.00s) Building folders structure. (0.01s) Compilazione del codice. (0.00s) Compilazione del codice di layouts (0.00s) Organizzazione Librerie. (0.00s) Compilazione del codice Java prodotto. Error B4J line: 13 Log(\ javac 1.8.0_241 src\b4j\example\main.java:64: error: unreachable statement ; ^ 1 error Line 13 is the Log(DateTime.Now & " Hello world!!!") Where is the error?
Erel B4X founder Staff member Licensed User Longtime User Oct 14, 2020 #2 This is considered invalid code. It will cause the app to freeze until it is killed. Add Sleep(0) if you want to create such loop. Upvote 0
This is considered invalid code. It will cause the app to freeze until it is killed. Add Sleep(0) if you want to create such loop.
amorosik Expert Licensed User Oct 14, 2020 #3 With Sleep(0) programm is terminated How to obtain an 'infinite loop' in B4J ? Upvote 0
DonManfred Expert Licensed User Longtime User Oct 14, 2020 #4 amorosik said: With Sleep(0) programm is terminated Click to expand... with which error? Upvote 0
amorosik Expert Licensed User Oct 14, 2020 #5 Without any error 'Program terminated (StartMessageLoop was not called).' on log windows Upvote 0
DonManfred Expert Licensed User Longtime User Oct 14, 2020 #6 amorosik said: Program terminated (StartMessageLoop was not called).' on log windows Click to expand... Add StartMessageLoop before the loop then Last edited: Oct 14, 2020 Upvote 0
amorosik said: Program terminated (StartMessageLoop was not called).' on log windows Click to expand... Add StartMessageLoop before the loop then
cklester Well-Known Member Licensed User Oct 14, 2020 #7 amorosik said: With Sleep(0) programm is terminated How to obtain an 'infinite loop' in B4J ? Click to expand... Have you tried "Do While True... Loop"? Upvote 0
amorosik said: With Sleep(0) programm is terminated How to obtain an 'infinite loop' in B4J ? Click to expand... Have you tried "Do While True... Loop"?