DIM

DIM V

DEFINES ONE OR SEVERAL VARIABLES

  • Type: Command
  • Parameters: n
  • Group: Reference

ACTION

The command defines one or several variables, simple or in array.

A variable name can contain letters, the character underscore ("_") or numbers, but the first character must be a letter.

A variable can be one out the 3 types : integer, real, string.

The type of a variable is defined by the last character of its name :

% for an integer variable

$ for a string variable

neither % nor $ for a real variable

An array is defined with its maximal number of elements.

SYNTAX: DIM V1[,Vn]

  • V1, V2, ... Vn : Variable names

USE

  • The statement DIM is used to define a variable used in the program.

ERROR

  • If the variable name contains symbols other than letters, character underscore or numbers.
  • If the variable is already defined.

EXAMPLE

dim a1,b2%,CC44$,abc(10),af078$(10,20)

SEE ALSO

ADR()

DIM_LOCAL

FREE