gjoisa Active Member Licensed User Longtime User Nov 25, 2012 #1 This code works B4X: Dim c as Int c = 1 Do While c < 11 b = c * 4 c = c + 1 Msgbox(b,"") Loop But this doesn't work B4X: Dim c as Int c = 1 Do While c + 10 b = c * 4 c = c + 1 Msgbox(b,"") Loop and also this Doesn't work B4X: Dim c as Int c = 1 Do While c > 9 b = c * 4 c = c + 1 Msgbox(b,"") Loop Why this limitation ?
This code works B4X: Dim c as Int c = 1 Do While c < 11 b = c * 4 c = c + 1 Msgbox(b,"") Loop But this doesn't work B4X: Dim c as Int c = 1 Do While c + 10 b = c * 4 c = c + 1 Msgbox(b,"") Loop and also this Doesn't work B4X: Dim c as Int c = 1 Do While c > 9 b = c * 4 c = c + 1 Msgbox(b,"") Loop Why this limitation ?
J Jost aus Soest Active Member Licensed User Longtime User Nov 25, 2012 #2 What do you mean with "doesn't work"? Your second example contains wrong syntax, as the while condition needs a boolean (and not an int). In your third example the while condition negates, so that the loop will never run. Upvote 0
What do you mean with "doesn't work"? Your second example contains wrong syntax, as the while condition needs a boolean (and not an int). In your third example the while condition negates, so that the loop will never run.
gjoisa Active Member Licensed User Longtime User Nov 25, 2012 #3 In my second example the code should be B4X: Do While c = 10 but this code doesnot work . Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 25, 2012 #4 In which way doesn't it work? c = 1 so it will not enter the block. Upvote 0
mc73 Well-Known Member Licensed User Longtime User Nov 25, 2012 #5 gjoisa said: In my second example the code should be B4X: Do While c = 10 but this code doesnot work . Click to expand... Somehow I think you meant to write B4X: do until c=10 Upvote 0
gjoisa said: In my second example the code should be B4X: Do While c = 10 but this code doesnot work . Click to expand... Somehow I think you meant to write B4X: do until c=10