Shop OBEX P1 Docs P2 Docs Learn Events
help with case statement — Parallax Forums

help with case statement

TectuTectu Posts: 22
edited 2011-08-01 06:07 in General Discussion
Hi Folks,

I need some help with the case statement in spin. How can i make something like this work?
    case i
      < 9:        debug.str(string(":    "))
      < 99:       debug.str(string(":   "))
      < 999:      debug.str(string(":  "))
      < 9999:     debug.str(string(": "))




Thanks for your help!

Greeting Tectu

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2011-08-01 06:03
    I think you want
        case i
          0..9:        debug.str(string(":    "))
          10..99:       debug.str(string(":   "))
          100..999:      debug.str(string(":  "))
          1000..9999:     debug.str(string(": "))
    
  • TectuTectu Posts: 22
    edited 2011-08-01 06:07
    Oh cool, that's working. Thank you very much, Dave!
Sign In or Register to comment.