DIM - source-solutions/HELP GitHub Wiki

DIM


DIM name {(|[} limit_0 [, limit_1] ... {)|]}

Allocates memory for arrays. The DIM statement also fixes the number of indices of the array. Unlike Microsoft BASIC, an array can be reallocated.

Parameters

  • name is a legal variable name specifying the array to be allocated.
  • limit_0, limit_1, ... are numeric expressions that specify the greatest index allowed at that position.

Notes

The size of arrays is limited by the available BASIC memory.

Errors

  • An index is empty: Syntax error.
  • An index is missing at the end: Missing operand.
  • limit_0, limit_1, ... have a string value: Type mismatch.
  • limit_0, limit_1, ... are not within [-32768 to 32767]: Overflow.
  • limit_0, limit_1, ... are negative: Illegal function call.
  • The array exceeds the size of available variable space: Out of memory.
⚠️ **GitHub.com Fallback** ⚠️