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.

The $STATIC Metacommand allows the creation of static (unresizable) arrays.

Syntax

{REM } $STATIC

Description

Example(s)

When a variable is used, the array can be resized despite $STATIC. The array becomes $DYNAMIC.


'$STATIC

INPUT "Enter array size: ", size
DIM array(size)   'using an actual number instead of the variable will create an error!

REDIM array(2 * size)

PRINT UBOUND(array) 

Note: DIM using a literal numerical size will create a Duplicate definition error.

See Also