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.19
Syntax FUNCTION AReplicate(
xFill AS USUAL,
nElements AS DWORD
) AS ARRAY
public static Array AReplicate(
Usual xFill,
uint nElements
)
Request Example
View SourceParameters
- xFill
- Type: Usual
The value with which to fill the array. - nElements
- Type: DWord
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:
1aNewArray := AReplicate(0, 10)
This example creates an array of 5 elements and fills it with "Empty" strings:
1aEmptyArray := AReplicate("Empty", 5)
See Also