This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Used to re-dimension a previously declared arrays.
Syntax
Syntax for standard arrays:
REDIM [PRESERVE] VariableName[(subscripts)]
Syntax for absolute arrays:
REDIM AbsoluteVariableName[(subscripts)] [AT address]
Returns
None
Parameters
Remarks
REDIM will preserve previous array data only if optional PRESERVE clause will be specified.
If PRESERVE is not present an empty array will be created and previous data will be deallocated.
If no subscripts will be indicated, array will be deallocated. So:
ReDim AnyArray
will just un-dimension AnyArray.
Restrictions
See also
Examples
'----------------------------------
'---Arrays ---
'----------------------------------
Dim MaxItems As Long Value 10000
Dim MyArray(MaxItems) As String
'---Undimensioned array redimensioned later
Dim MyUndimensionedArray() As String
'...
ReDim MyUndimensionedArray(MaxItems)
'----------------------------------
'---Example using absolute array---
'----------------------------------
Dim Mystring AS STRING
Mystring = "AA"
Dim MyArray(Len(MyString)) AS BYTE AT STRPTR(MyString)
'---Array containing 2 byte values 65,65
Mystring = "AAAA"
REDIM MyArray(Len(MyString)) AT STRPTR(MyString) ' Array containing 4 byte values 65,65,65,65