radiosparks
Member
Hi
I've been reading the manuals, front to back to front Yup, the smiley looks like me.
Could it be a coding error found in the sample code of the online and PDF manuals?
Example for ON GOTO, BRANCH has the same issue.
The label bnt0 will never be executed, because, variable b1 is incremented (INC b1) before the ON GOTO or BRANCH statement.
Code from online manual:::
Here is the amended code, I think it should be:::
I've placed the (INC b1) after the ON b1 GOTO. Also added a GOTO MAIN to close the loop, in case of a fall through to the btn labels below.
Does this help anyone??
I've been reading the manuals, front to back to front Yup, the smiley looks like me.
Could it be a coding error found in the sample code of the online and PDF manuals?
Example for ON GOTO, BRANCH has the same issue.
The label bnt0 will never be executed, because, variable b1 is incremented (INC b1) before the ON GOTO or BRANCH statement.
Code from online manual:::
Code:
reset1:
let b1 = 0
low B.0
low B.1
low B.2
low B.3
main:
inc b1
if b1 > 4 then reset1
on b1 goto btn0, btn1, btn2, btn3, btn4
btn0:
high B.0
goto main
btn1:
high B.1
goto main
btn2:
high B.2
goto main
btn3:
high B.3
goto main
btn4:
high B.4
goto main
I've placed the (INC b1) after the ON b1 GOTO. Also added a GOTO MAIN to close the loop, in case of a fall through to the btn labels below.
Code:
reset1:
let b1 = 0
low B.0
low B.1
low B.2
low B.3
main:
if b1 > 4 then reset1
on b1 goto btn0, btn1, btn2, btn3, btn4
inc b1
goto main
btn0:
high B.0
goto main
btn1:
high B.1
goto main
btn2:
high B.2
goto main
btn3:
high B.3
goto main
btn4:
high B.4
goto main