Shop OBEX P1 Docs P2 Docs Learn Events
BS2 select code — Parallax Forums

BS2 select code

towerhandtowerhand Posts: 6
edited 2011-03-08 17:36 in BASIC Stamp
Thank you for your responses. Program is working.

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2011-03-08 04:52
    Have you looked at the example in the Helpfile under "Select....Case"? The structure is quite straightforward.

    Cheers,
  • vaclav_salvaclav_sal Posts: 451
    edited 2011-03-08 07:34
    Subroutines are great , I use them any time I have more that 5 "common" instructions.
    But in you case there will be little improvement in your code because you just change I/O and run same PAUSE.
    PBasic wants to have the variable assigned before you call the subroutine.

    I would suggest looking into LOOKUP , but do it after you figure out subroutine.

    Start with putting PAUSE as subroutine

    Delay VAR Byte

    MyPause:
    PAUSE Delay
    RETURN

    To call MyPause
    ...
    Delay = 150
    GOSUB MyPause
    ....
    ....
    Delay = 100
    GOSUB MyPause
    ...


    Cheers Vaclav
  • towerhandtowerhand Posts: 6
    edited 2011-03-08 17:36
    Thank you.
Sign In or Register to comment.