csprouse said...
I am programming the BS2 to display stuff on an LCD. Baby stuff for you all. Why do IF statements cause the programs to ask for 'labels'?
Normally they don't.
Can we see the code you're using that causes this problem? Use the attachment manager (below) to attach it to your post.
Try clicking the PBasic Language 2.5 button at the top of the screen (see the little "1.0 2.0 2.5" buttons?).
I just hooked up a BS2 with an LCD, added the "2.5" and ran your program - it seems to work just fine. The "IF...THEN...ELSE" structure is only found in PBasic 2.5: that's why you're getting weird results when you don't include the compiler directive.
Post Edited (sylvie369) : 11/3/2008 1:46:43 AM GMT
I make it a habit to use both the $STAMP and the $PBASIC directives in every program. There are other mysterious glitches waiting to pounce if you don't.
Comments
x var byte
If x > 3 then gosub bigger
If x = 5 then
x=3
gosub five
endif
bigger:
Debug "X is bigger"
return
five:
Debug "X is 5"
return
Normally they don't.
Can we see the code you're using that causes this problem? Use the attachment manager (below) to attach it to your post.
I hope the code attached.
I just hooked up a BS2 with an LCD, added the "2.5" and ran your program - it seems to work just fine. The "IF...THEN...ELSE" structure is only found in PBasic 2.5: that's why you're getting weird results when you don't include the compiler directive.
Post Edited (sylvie369) : 11/3/2008 1:46:43 AM GMT
I make it a habit to use both the $STAMP and the $PBASIC directives in every program. There are other mysterious glitches waiting to pounce if you don't.