Shop OBEX P1 Docs P2 Docs Learn Events
THEN command? — Parallax Forums

THEN command?

Leticia ProjectLeticia Project Posts: 30
edited 2006-01-08 10:56 in BASIC Stamp
Hi!

How can I use a IF and THEN command in BS2?
I would like to write a code like this:

Slow:
IF IN1=1 AND IN6=0 THEN
· GOSUB slowservo
ENDIF
RETURN

But the Debugger only tell me that THEN should have a label?
I want the program to continue on the next line, without using another label, is this possible? smile.gif

Thank you!

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-06 22:18
    You need to activate PBASIC 2.5 syntax.· Like this:

    ·' {$PBASIC 2.5}

    -- you'll find a button on the toolbar that will insert this for you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Leticia ProjectLeticia Project Posts: 30
    edited 2006-01-07 11:02
    I actually have done that!

    I don`t see why the program won`t accept this THEN command. Could I be using the wrong program? I`ve attached my program if anyone would like to try?

    Thank you!

    Jens Gr
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-01-07 13:35
    Jens -

    Indeed you MUST be using the wrong program. The one you attached goes through the Stamp Editor/Compiler with NO ERRORS.

    Regards,

    Bruce Bates
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-07 15:14
    Jens,

    Do make sure that you've got the latest version of our editor: 2.2.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Leticia ProjectLeticia Project Posts: 30
    edited 2006-01-08 10:56
    I probably do have the wrong program [noparse]:)[/noparse]
    As stupid as I am I used a the program from a old book about programming. I will download the new one right away!

    Thank you!
Sign In or Register to comment.