Shop OBEX P1 Docs P2 Docs Learn Events
Using BREAK — Parallax Forums

Using BREAK

eduardomoraiseduardomorais Posts: 11
edited 2010-11-23 05:04 in Propeller 1
Hello everybody!

Could someone answer me how I could make a BREAK, if given the chance, in SPIN?
I'm needing to use a CASE, but encounter problems by putting the BREAK between the cases.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2010-11-22 19:46
    I'm not sure what you mean. Can you give an example?

    If you post code as an example remember to use the # symbol to so you code keeps its format.

    Duane
  • jazzedjazzed Posts: 11,803
    edited 2010-11-22 20:16
    Could someone answer me how I could make a BREAK, if given the chance, in SPIN?
    I'm needing to use a CASE, but encounter problems by putting the BREAK between the cases.
    There is no BREAK in SPIN. CASE is simple.
    PUB isAlpha(char)
      case char
        "a".."z","A".."Z":
          result := true
        other:
          result := false
    
  • Mike GreenMike Green Posts: 23,101
    edited 2010-11-22 20:25
    If you're used to C's SWITCH statement, Spin's CASE statement is more like Pascal's. There's an implied BREAK for every case.
  • eduardomoraiseduardomorais Posts: 11
    edited 2010-11-23 05:04
    Thank you!:smilewinkgrin:

    I got knowledge could understand how it works.
Sign In or Register to comment.