Shop OBEX P1 Docs P2 Docs Learn Events
Do Loops in Pbasic — Parallax Forums

Do Loops in Pbasic

I am currently building the BOE-BOT. My hardware is ' {$STAMP BS2} ' {$PBASIC 2.0}.

Pbasic is running fine and shows commands in blue on my Windows 8.1 PC. When I do a "DO LOOP", neither command is blue and it does not loop. Have tried many things and still looks like I have a Software Package or Hardware issue. I have used do loops in at lease 3 or 4 other programing languages and I know what to expect. I have inserted messages for me to debug with and they show one time and then out of the loop and on with the program. It does not give me an error message, it just reads and ignores the commands. Any help is appreciated. Thanks Floyd (New User)

Comments

  • PublisonPublison Posts: 12,366
    edited 2015-08-28 16:17
    Welcome to the forums!


    You probably want to be using PBasic 2.5. (Select at the top of the IDE).

    You can check to see if you have the latest PBasic package:

    https://www.parallax.com/Downloads

  • Yes, I have updated it to the current version. It is the weirdest thing I have come across in a long time. Thanks
  • PublisonPublison Posts: 12,366
    edited 2015-08-28 16:55
    But did you change PBasic 2.0 to PBasic 2.5. PBasic 2.0 does not support Do..Loop.

    Could you post the code here so we can take a look at it?

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2015-08-28 16:59
    Adams449,

    At the top of your program, change '{PBASIC 2.0} to '{PBASIC 2.5}, and make sure it's on a line by itself.

    -Phil
  • I finally beat Phil to and answer. :)
  • Well changing it to read 2.5 did the trick. It works fine now. I like it when there is a solid forum for helping us 66 year old newbe's out. Thanks again Floyd
  • PublisonPublison Posts: 12,366
    edited 2015-08-28 17:19
    Good deal Floyd!

    This is one of the best forums around.

  • Hey Floyd,

    At the top of the PBASIC IDE, you'll see a string of Stamp icons and to the right of those, a set of three cogs(?) labeled 1.0, 2.0, and 2.5.

    Clicking on the Stamp icons will insert the various {$STAMP BS?} directives at the top of the open edit window. Clicking on the cogs will insert the {$PBASIC 2.?} directives on the next line.

    From one old/newbie to another,

    Dave
    337 x 114 - 3K
Sign In or Register to comment.