Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Line of sight
#13
While you are at it, you should try to solve the type casting of some expressions... This should work:

Code:
Dim lsb, msb as uByte
Dim address as uInteger

...

address = lsb + (msb << 8)

But it doesn't, as it tries to shoft msb left 8 times but using 8 bits, so it always equals 0. You have to define msb as uInteger for it to work correctly.

In the same fashion:

Code:
Dim x, cx as uByte
Dim dx uInteger

...

dx = x - cx

dx is always positive, as x and cx are unsigned... But the results should be considered signed integer, and not unsigned char.

I find this to be the biggest problem with the compiler. No other language that I know behaves that way, and it forces you to find dirty walkarounds.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)