PBASIC 2.5 and labels
Don
Posts: 34
I downloaded the short document the PBasic 2.5 features.· I was a bit puzzled by the discussion of labels requiring a colon.· I thought that labels have always required a colon.· It this not true?· If not, in what circumstances would you want to use a label without a colon?
Perhaps not requiring a colon on labels was an oversight/bug in versions prior to 2.5.
·
Perhaps not requiring a colon on labels was an oversight/bug in versions prior to 2.5.
·
Comments
Colons can also be used as a separater for multi-line statements, like this:
· DO : LOOP UNTIL (ResetBtn = Pressed)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
In your example of multi-line statements, is it required to have a space after the DO to prevent the compiler from interpreting it as a label. I assume that if this is the case, it would then complain about using a reserved word as a label.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office