| | Create a new one-dimensional array with count items.
All items are set to their default value (NIL, FALSE, 0).
|
| Return the number of items a one-dimensional array can hold.
It does not matter if some array entries were never set, they will have
the default value (NIL, FALSE, 0).
When used on NIL Size() returns zero, it does not throw an E.NilAccess
exception.
|
| Return a string representation of the array.
Starts with "[" and ends in "]". Items are separated with ", ".
An empty array returns "[]".
string s = ["a", "b"].ToString()
# s == "["a", "b"]".
A NIL array returns "NIL"
Each item is converted to a string by calling its ToString() method, if
there is one.
If the list contains itself somehow, instead of recursing
"[recursive-array]" will be used. However, if multiple threads are doing
this for the same array the effect is unpredictable.
|
| Return a string representation of the array with specified formatting.
Currently works like ToString() without a format argument.
TODO: limit depth, limit number of items (like string truncation,
optional ellipses), etc.
|
| Return the type of the array.
Invoking ToString() on the returned type results in something like
"array<string>".
|
| Return the index of the first item that equals item.
When Titem is a value type, a string or a byteString then the value is
compared. Otherwise IS is used, the item at the index IS item.
Returns -1 if item is not found or when the array is NIL.
|
| Call method f for every item in the array.
The argument for f is the value of the item.
Returns the array.
|
| Call method f for every item in the array.
The first argument for f is the index in the array, the second argument is
the value of the item.
Returns the array.
|
| Return TRUE if there is an item that equals item.
This is equivalent to:
$find(item) != -1
Returns FALSE when the array is NIL.
|
| Execute function f on each item. Each item is replaced by the result
of the function.
f has two arguments: The index in the array and the current value of the
item. f must return the new value of the item.
Keep in mind that items have their default value when never set, which
an be NIL.
When the array is NIL nothing happens.
array<string> a = ["a", "b", "c"]
a.keyMap({ i, s => i .. ":" .. s })
# a == ["0:a", "1:b", "2:c"]
Returns the array.
|
| Create a new array where each item is the result of executing function f
on each item of this array.
This is like keyMap() but with a different result type.
f has two arguments: The index in the array and the value of the item.
f must return the value for the new array.
array<int> il = [11, 22, 33]
array<string> sl = il.keyMapTo({ i, n => i .. ": " .. n })
# sl == ["0: 11", "1: 22", "2: 33"]
Returns the new array. Returns NIL when the array is NIL.
|
| Execute function f on each item. Each item is replaced by the result
of the function.
f has one argument, which is the current value of the item, and must
return the new value of the item.
Keep in mind that items have their default value when never set, which
can be NIL.
When the array is NIL nothing happens.
array<string> a = ["a", "b", "c"]
a.map({ s => s .. ":" })
# a == ["a:", "b:", "c:"]
Returns the array.
|
| Create a new array where each item is the result of executing function f
on each item of this array.
This is like map() but with a different result type.
f has one argument, which is the value of the item, and must return the
value for the new array.
array<int> ia = [1, 2, 3]
array<string> sl = ia.mapTo({ n => n .. ":" })
# sl == ["1:", "2:", "3:"]
Returns the new array. Returns NIL when the array is NIL.
|
| Resize a one-dimensional array to contain count items.
If the array was larger before, the items at count and further are
discarded.
If the array was smaller before, the new item locations are set to the
default value (NIL, FALSE, 0).
Returns the array.
|
| Set the items starting at position index to the byteString values.
Titem must be a number type: int or byte.
If values contains more items that the array has space then the extra
items are not used.
Returns the array.
|
| Set the items starting at position index to the array values.
If values contains more items that the array has space then the extra
items are not used.
Returns the array.
|
| Set the items starting at position index to the list values.
If values contains more items that the array has space then the extra
items are not used.
Returns the array.
|
|