ReDim: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "REDIM [PRESERVE] nameA[([subscriptA[, subscriptB[, <br /> :::subscriptC...]]])][, nameB...[, nameC...[...]]] '''Description''' REDIM is used to reallocate storage space for ...")
 
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
REDIM [PRESERVE] nameA[([subscriptA[, subscriptB[, <br />
ReDim [''Preserve''] ''nameA''[([''subscriptA''[, ''subscriptB''[,''subscriptC''...]]])][, ''nameB''...[, ''nameC''...[...]]]
:::subscriptC...]]])][, nameB...[, nameC...[...]]]


'''Description'''
== Description ==


REDIM is used to reallocate storage space for fixed arrays. The required component, ''name'', is the name of the variable, and it must follow standard variable naming conventions. The optional list of subscript arguments are the dimensions of an array variable, up to 60 comma separated, numeric expressions can be used. The optional keyword, PRESERVE will preserve data in an existing array, when only the size of the last dimension is changed. The lower bound of an array is always 0.
ReDim is used to reallocate storage space for fixed arrays. The required component, ''name'', is the name of the variable, and it must follow standard variable naming conventions. The optional list of subscript arguments are the dimensions of an array variable, up to 60 comma separated, numeric expressions can be used. The optional keyword, ''Preserve'' will preserve data in an existing array, when only the size of the last dimension is changed. The lower bound of an array is always 0.


'''Example'''
== Example ==


<pre>
<pre>
REM REDIM Example
Rem ReDim Example
'REDIM reallocates array storage
'ReDim reallocates array storage
'An empty variable named "Foo"
'An empty variable named "Foo"
DIM Foo
Dim Foo
'A one-dimensional array with 10 elements
'A one-dimensional array with 10 elements
REDIM Foo(9)
ReDim Foo(9)
'A two-dimensional array with 600 elements
'A two-dimensional array with 600 elements
'20 x 30
'20 x 30
REDIM Foo(19, 29)
ReDim Foo(19, 29)
</pre>
</pre>


'''Related Items'''
== Related Items ==


[[array|ARRAY]], [[dim|DIM]]
[[array|Array]], [[dim|Dim]]
 
[[Category:Language Reference]]
 
[[Category:Variables]]

Latest revision as of 11:58, 6 November 2012

ReDim [Preserve] nameA[([subscriptA[, subscriptB[,subscriptC...]]])][, nameB...[, nameC...[...]]]

Description

ReDim is used to reallocate storage space for fixed arrays. The required component, name, is the name of the variable, and it must follow standard variable naming conventions. The optional list of subscript arguments are the dimensions of an array variable, up to 60 comma separated, numeric expressions can be used. The optional keyword, Preserve will preserve data in an existing array, when only the size of the last dimension is changed. The lower bound of an array is always 0.

Example

Rem ReDim Example
'ReDim reallocates array storage
'An empty variable named "Foo"
Dim Foo
'A one-dimensional array with 10 elements
ReDim Foo(9)
'A two-dimensional array with 600 elements
'20 x 30
ReDim Foo(19, 29)

Related Items

Array, Dim