ArrayFill Command

Purpose

Initializes a numerical array of any type with a value.

Syntax

ArrayFill a(),x

a():any numeric or Boolean array

x:aexp

Description

The ArrayFill a(),x command can be used on all numeric and Boolean arrays. The complete array a(), including all dimensions, is filled with the expression x. By default, all dimensioned numeric arrays are cleared with 0, while all Boolean arrays are initialized with False - which is also 0.

Example

OpenW # 1

Dim a(10), b%(3, 4), c%(2, 3, 4), d|(1, 2, 3, 4), e!(5)

ArrayFill a(), 17.4

ArrayFill b%(), 13

ArrayFill c%(), 17

ArrayFill d|(), 9

ArrayFill e!(), True

Print a(1)    // Prints 17.4

See Also

Mat Set

{Created by Sjouke Hamstra; Last updated: 23/09/2014 by James Gaite}