Back to index

Dim statement
Used to declare and allocate storage space for variables and arrays.

Format:

  Dim name[ (boundlist) ] [ As type ] 

Syntax:

See also:

- Assign statement: Assigns variable, constant, or expression to variable or array item
- Using arrays

Example:

  ' Declare variable s. It can change its type freely
  Dim s
  
  Dim Number As Integer
  Dim MyInt1, MyInt2 As Integer
  Dim MyInt As Integer, MyFloat As Floating

  ' Array declarations
  Dim MyArray(50) ' Array of 50 elements

  ' Matrix is a two-dimensional array of type Integer.
  Dim Matrix(3, 4) As Integer 

  ' Matrix3 is a three-dimensional array of type Floating.
  Dim Matrix3(5, 9, 5) As Floating


Copyright (c) 2000-2006 by Smartphoneware. All rights reserved.