-->
Page 1 of 1

Logic operator doesn't work in a do loop while loop

PostPosted: Sun Feb 11, 2018 9:09 am
by Alberto_2
Code: (that doesn't work)

msg = ""
cnt = 1
do
cnt = cnt + 1
delay 500
loop while len(msg) < 38 or cnt < 22
If cnt > 21 then goto [repet]

Code: (that work)

msg = ""
cnt = 1
do
cnt = cnt + 1
If cnt > 21 then goto [repet]
delay 500
loop while len(msg) < 38


Question 1: Why the logic "or" stops the loop and does prevent string "msg" to load ?
Question 2: Is it safe to exit the "do/loop while" with a goto instruction?

Thank you for the attention.


Edited: Missing "THEN" was a typo! The question remain. Interested in question 2

Alberto

Re: Logic operator doesn't work in a do loop while loop

PostPosted: Sun Feb 11, 2018 12:09 pm
by Electroguard
IF you read the Doc syntax THEN you'll see that you are missing half of it...