
|
INFO - FAQ - CC2-Forum - CCPro-Forum |
|
||
|
> Thanks Achim, I’ll be the first to admit that you are correct! ;) > Your idea also gave me a new idea, have a look. > It looks a lot “cleaner” this way. > temp = (variable and 61440) shr 12 : if temp < 10 then put temp + &h30 else put temp + &h37 > temp = (variable and 3840) shr 8 : if temp < 10 then put temp + &h30 else put temp + &h37 > temp = (variable and 240) shr 4 : if temp < 10 then put temp + &h30 else put temp + &h37 > temp = (variable and 15) : if temp < 10 then put temp + &h30 else put temp + &h37 Wouldn't it be so much more "readable" if you used hex constants for the bit masks? (variable and &HF000) shr 12 (variable and &H0F00) shr 8 (variable and &H00F0) shr 4 (variable and &H000F) Just my 2 cents Bye Achim |
| Antwort schreiben |