Logic operator doesn't work in a do loop while loop
Posted: Sun Feb 11, 2018 9:09 am
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
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