Shop OBEX P1 Docs P2 Docs Learn Events
Program Compilation Issues — Parallax Forums

Program Compilation Issues

anonpoetanonpoet Posts: 2
edited 2006-03-20 17:53 in BASIC Stamp
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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-20 17:49
    Troy,

    ·· 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
  • anonpoetanonpoet Posts: 2
    edited 2006-03-20 17:50
    That was it! I knew it must have been something simple. Should have followed the directions better!

    Thanks, I am off and coding again. I feel giddy like a kid, this is a blast. [noparse]:)[/noparse]

    Troy
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-20 17:53
    No problem...I would always include that line in all programs just to be sure.· That's the first thing I do when starting a new program.· I click the Stamp Directive icon and then PBASIC 2.5 icon (Both on toolbar).· Enjoy!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.