Shop OBEX P1 Docs P2 Docs Learn Events
Prop IDE compile error? — Parallax Forums

Prop IDE compile error?

HShankoHShanko Posts: 402
edited 2011-08-28 15:39 in Propeller 1
Anyone run into this sort of 'error'? In the 'fix_hex' PUB, originally I had '=>' instead of '>=' and all I got was an '00' result on the LCD. But the compiler did NOT post any sign of an error. Took a lot of head scratching until I narrowed the problem down to that line; it was never taking that path, just the 'else',

Does '=>' have any meaning? If not why not a Compile error?
PUB wr_hex
  n := chr                      ' save value
  chr >>= 4                     ' get ms nybble
  fix_hex                       ' convert to ASCii
  chr := n & $0F                ' get ls nybble
  fix_hex

PUB fix_hex
  if chr >= 10                  ' check if greater than 9 (A..F)
    chr += $37                  ' form ASCII 'A'..'F'
  else
    chr += $30                  ' else, form '0'..'9'
  wr_LCD

Comments

  • SRLMSRLM Posts: 5,045
    edited 2011-08-28 15:29
    '=>' is a comparison operator called 'Boolean is Equal or Greater', and is on page 277 of the Propeller Manual v1.0.
  • HShankoHShanko Posts: 402
    edited 2011-08-28 15:39
    For some reason I kept looking on the 2nd column and didn't note what's on pg 157, Prop manual v1.0. Thanks. Maybe my thumb was on lower left of page, covering it.
Sign In or Register to comment.