The "array_fill" Function
#
SyntaxArgument | Type | Description |
---|---|---|
id | array | The index of a previously-created array to modify |
[value] | any | Optional: Sets a value to assign to all new cells (default 0 ) |
#
DescriptionFinds the longest dimension of a multidimensional array and fills all other dimensions to match the same length, optionally assigning a default value to any new cells created. If a custom value is not specified, 0
will be used by default.
Can be useful for parsing arrays where the parser must assume a certain size for all dimensions of an array. However, note that this function fills array length only. Sub-dimensions can still be non-uniform in depth, which cannot be solved by this function, as doing so would result in data loss.