PDA

View Full Version : THEN command?



Leticia Project
01-07-2006, 06:11 AM
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? http://forums.parallax.com/images/smilies/smile.gif

Thank you!

Jon Williams
01-07-2006, 06:18 AM
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 Project
01-07-2006, 07:02 PM
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önberg

Bruce Bates
01-07-2006, 09:35 PM
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 Williams
01-07-2006, 11:14 PM
Jens,

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

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Leticia Project
01-08-2006, 06:56 PM
I probably do have the wrong program :)
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!