Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Small brackets-parsing glitch (*solved*)
#1
Messing around with some of my other code over lunchtime with the latest beta (2100), I discovered a small error when parsing brackets.

Take a look at this code:
Code:
DIM test(10, 10) as UBYTE
DIM x as UBYTE
DIM y as UBYTE

x = 5
y = 5

PRINT test(x - 1, y)
PRINT test((x - 1), y)
PRINT test(x, y - 1)
PRINT test(x, (y - 1))

The final PRINT statement will not compile unless you remove the brackets from around the (y - 1). Strangely, the brackets seem to be okay if we're dealing with the first dimension of the array (so it's okay to have 'x - 1' in brackets), just not for the second. :-)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)