CreateArrayRept

Mon 01 January 2018

Syntax

CreateArrayRept(val, count)

Description

Use the CreateArrayRept function to create an array that contains count copies of val . If val is itself an array, the created array has one higher dimension, and each element (sub-array) is the array reference val .

The type of the first parameter ( val ) determines the type of array that is built. That is, if the first parameter is of type NUMBER, an array of number is built. If count is zero, CreateArrayRept creates an empty array, using the val parameter for the type.

If you are making an array that is multi-dimensional, val will be the subarray used as the elements.

To make the subarrays distinct, use the Clone method. For example:

&A = CreateArrayRept(&AN, 4).Clone();

Parameters

Field or Control

Definition

val

A value of any type.

count

The number of copies of val contained in the array.

Returns

Returns a reference to the array.