Original Author Paul Laughton, 2011
Page 41
De Re BASIC!
Multiple arrays can be dimensioned with one Dim statement. String and numeric arrays can be
dimensioned in a single Dim command.
Examples:
DIM A[15]
DIM B$[2,6,8], C[3,1,7,3], D[8]
UnDim Array[]{, Array[] } ...
Un-dimensions an array. The array is destroyed, releasing all of the memory it used. Multiple arrays can
be destroyed with one UnDim statement. Each Array[] is specified without any index. This command is
exactly the same as Array.delete.
Array.average <Average_nvar>, Array[{<start>,<length>}]
Finds the average of the values in a numeric array (Array[]) or array segment (Array[start,length]), and
places the result into <Average_nvar>.
Array.copy SourceArray[{<start>,<length>}], DestinationArray[{{-}<start_or_extras>}]
Copies elements of an existing SourceArray[] to the DestinationArray[]. If the Destination Array exists,
some or all of the existing array is overwritten. If the Destination Array does not exist, a new array is
created. The arrays may be either numeric or string arrays but they must both be of the same type.
You may copy an entire array (SourceArray[]) or an array segment (SourceArray[<start>,<length>]).
Copying stops without error if it reaches the end of either the SourceArray or the DestinationArray.
If <start> is < 1 it is set to 1, the first element of the SourceArray. If <length> is < 0 it is set to 0.
If the Destination Array already exists, the optional <start_or_extras> parameter specifies where to start
copying into the Destination Array.
If the Destination Array does not exist, the optional <start_or_extras> parameter specifies how many
extra elements to add to the copy. If the parameter is a negative number, these elements are added to
the start of the array, otherwise they are added to end of the array.
The extra elements for a new numeric array are initialized to zero. The extra elements for a new string
array are initialized to the empty string, "".
See the Sample Program file, f26_array_copy.bas, for working examples of this command.
Array.delete Array[]{, Array[]} ...
Does the same thing as UnDim Array[].
Array.dims Source[]{, {Dims[]}{, NumDims}}
Provides information about the dimensions of the Source[] array parameter. The Source[] parameter
may be a numeric or string array name with nothing in the brackets ("[]"). The array must already exist.
The Source[] parameter is required, and both of the other parameters are optional.