Click or drag to resize

AReplicate Function

To create an array and fill its elements with a default value.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.08
Syntax
 FUNCTION AReplicate(
	xFill AS USUAL,
	nElements AS DWORD
) AS ARRAY
View Source

Parameters

xFill
Type: Usual
The value with which to fill the array.
nElements
Type: UInt32
The size of the array.

Return Value

Type: Array
An array <nElements> elements long, each element containing <xFill>.
Remarks
Examples
This example creates an array of 10 elements and fills it with zeros:
X#
aNewArray := AReplicate(0, 10)
This example creates an array of 5 elements and fills it with "Empty" strings:
X#
aEmptyArray := AReplicate("Empty", 5)
See Also