QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

OPTION _EXPLICITARRAY instructs the compiler to require arrays be declared with DIM, REDIM or equivalent.

Syntax

OPTION _EXPLICITARRAY

Description

Error(s)

Example(s)

Avoiding simple typos with OPTION _EXPLICITARRAY results shown in the QB64 IDE Status area.


OPTION _EXPLICITARRAY
x = 1 'This is fine, it's not an array so not affected

DIM z(5)
z(2) = 3 'All good here, we've explicitly DIMmed our array

y(2) = 3 'This now generates an error

QB64 IDE Status will show:

Array ‘y’ (SINGLE) not defined on line 7

See Also