Shop OBEX P1 Docs P2 Docs Learn Events
If THEN (ask for LABEL — Parallax Forums

If THEN (ask for LABEL

BertGBertG Posts: 1
edited 2014-08-20 15:48 in BASIC Stamp
Here is my program copied from"Wht's a Microcontroller" page76. Some changes to try other ideas.
Everything I try I get "except "LABEL" after the THEN.
DO


DEBUG ? IN3

IF (IN3 = 1) THEN ' ask for a "label"
HIGH 14
PAUSE 50
LOW 14
PAUSE 50


else 'will not blue this name
' PAUSE 50


END ' will not blue this name


loop ' will not blue this name




END ' will blue this name

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-08-20 15:46
    You need to specify at the top of your program that you're using PBASIC 2.5:
    ' {STAMP BS2}
    ' {PBASIC 2.5}
    

    BTW, welcome to the Parallax forum!

    -Phil
  • SapphireSapphire Posts: 496
    edited 2014-08-20 15:48
    Your using PBASIC 2.0 which doesn't support IF..THEN..ELSE

    Add


    ' {$PBASIC 2.5}


    at the top of your program.

    You can just click on the 2.5 in the toolbar to do this.
Sign In or Register to comment.