Program Compilation Issues
anonpoet
Posts: 2
After hearing Paul Verhage's presentation on Robotics at the Boise Code Camp Conference in Boise, Idaho I rushed out and got myself a BASIC Stamp Kit (the $79 one) from Ratshack.
I must say, I have been having a load of fun playing around with the kit!
I have run into one problem. I can program my kit just fine and compile and run code except for If THEN statements.
When I try to compile an IF THEN statement with the 2.0 GUI or the 2.1 beta both of them give me this error popup box: Expected a label. It occurs right at the first IF THEN statement.
I have tried searching through the docs and forum postings to no avail. Can anyone help me?
Here is my code (It came right out of the manual):
'{$STAMP BS2}
duration VAR Word
duration = 750
IF IN3 = 1 THEN
IF duration > 500 THEN
duration = duration - 25
endif
endif
DEBUG HOME, DEC4 duration, " = duration"
I haved tried with ( ) around the logic statement with the same results. I have tried a one line if statement and it only works if I use a subroutine label after the THEN statement.
Any help would be appreciated! [noparse]:)[/noparse]
Thanks,
Troy
Post Edited By Moderator (Chris Savage (Parallax)) : 3/20/2006 5:49:57 PM GMT
I must say, I have been having a load of fun playing around with the kit!
I have run into one problem. I can program my kit just fine and compile and run code except for If THEN statements.
When I try to compile an IF THEN statement with the 2.0 GUI or the 2.1 beta both of them give me this error popup box: Expected a label. It occurs right at the first IF THEN statement.
I have tried searching through the docs and forum postings to no avail. Can anyone help me?
Here is my code (It came right out of the manual):
'{$STAMP BS2}
duration VAR Word
duration = 750
IF IN3 = 1 THEN
IF duration > 500 THEN
duration = duration - 25
endif
endif
DEBUG HOME, DEC4 duration, " = duration"
I haved tried with ( ) around the logic statement with the same results. I have tried a one line if statement and it only works if I use a subroutine label after the THEN statement.
Any help would be appreciated! [noparse]:)[/noparse]
Thanks,
Troy
Post Edited By Moderator (Chris Savage (Parallax)) : 3/20/2006 5:49:57 PM GMT
Comments
·· You do not have the PBASIC 2.5 syntax enabled.· Please select it from the directive menu or click on the 2.5 on the toolbar.· That should get you going.· You should also use a descriptive subject for your messages, but I have fixed this one for you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thanks, I am off and coding again. I feel giddy like a kid, this is a blast. [noparse]:)[/noparse]
Troy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com