Why is this code not working?
I don't know why this does not work. I'm not very good with spin yet and am trying to convert a degree reading (0 - 360) to compass points. The error is "Expected end of line between the two N's on the NNE line. Any help appreciated.
PUB convertHeading (degrees) | Heading
case degrees
0..11 : Heading := "N"
12..34 : Heading := "NNE"
35..56 : Heading := "NE"
57..79 : Heading := "ENE"
80..101 : Heading := "E"
102..124: Heading := "ESE"
125..146: Heading := "SE"
147..169: Heading := "SSE"
170..191: Heading := "S"
192..214: Heading := "SSW"
215..236: Heading := "SW"
237..259: Heading := "WSW"
260..281: Heading := "W"
282..304: Heading := "WNW"
305..326: Heading := "NW"
327..348: Heading := "NNW"
348..360: Heading := "N"

Comments
case degrees 0..11 : Heading :=@N 12..34 : Heading :=@NNE 35..56 : Heading :=@NE debug.str(Heading) dat N byte "N",0 NNE byte "NNE",0 NE byte "NE",0Jeff T.
PUB convertHeading (degrees) case degrees 0..11 : Heading := "N" 12..34 : Heading := ("E"<<16)|("N"<<8)|"N" 35..56 : Heading := ("N"<<8)|"E" 57..79 : Heading := ("E"<<16)|("N"<<8)|"E" 80..101 : Heading := "E" 102..124: Heading := ("E"<<16)|("S"<<8)|"E" 125..146: Heading := ("S"<<8)|"E" 147..169: Heading := ("E"<<16)|("S"<<8)|"S" 170..191: Heading := "S" 192..214: Heading := ("W"<<16)|("S"<<8)|"S" 215..236: Heading := ("S"<<8)|"W" 237..259: Heading := ("W"<<16)|("S"<<8)|"W" 260..281: Heading := "W" 282..304: Heading := ("W"<<16)|("N"<<8)|"W" 305..326: Heading := ("N"<<8)|"W" 327..348: Heading := ("W"<<16)|("N"<<8)|"N" 348..360: Heading := "N"and it is called like this.While I like to write my own code, when I find something really elegant and useful I will snatch it up and put it to use -- such is the case with the rjdec() methd. That code (if under a different method name), I believe, was written by Dave Hein.