When declaring an array with an arithmetic expression in its bounds, QBJS only reads the first variable / literal rather than evaluating the full expression
Minimal reproducible program
dim grid(32 \ 8, 64 \ 8) as integer
print str$(ubound(grid, 1)) + str$(ubound(grid, 2))
Expected output (matches QB64PE and VB6 behaviour):
Actual output in QBJS:
Workaround: Pre-evaluate the expression into a const before the dim statement
const rows = 32 \ 8
const cols = 64 \ 8
dim grid(rows, cols) as integer
print str$(ubound(grid, 1)) + str$(ubound(grid, 2))
When declaring an array with an arithmetic expression in its bounds, QBJS only reads the first variable / literal rather than evaluating the full expression
Minimal reproducible program
Expected output (matches QB64PE and VB6 behaviour):
Actual output in QBJS:
Workaround: Pre-evaluate the expression into a
constbefore thedimstatement