If the addition succeeds, the length of the array increases by one and the function returns either the value <xValue>, _if one specified_, or NIL.
Note that the presence of the 2nd argument (or at least the comma next to the 1st one, in which case NIL is implied as xValue) is mandatory, even if a specific xValue is not meant to be simultaneously added, otherwise RTE occurs; in such a case, the effect is identical to _ASize(aArray, Len(aArray)+1)_.
Duplicates an array (Deep Copy). Works with multidimensional arrays.
Copy elements from a source array into a target array. Operates only on one-dimensional arrays.
Returns an array with all the days names in the selected current language.
Deletes the element at position <nPosition> from the array <aArray>. All subsequent elements are shifted up by one position so that the last element contains the value NIL. See hb_Adel() for extra functionality.
Evaluates the <bBlock> for each element into <aArray>, starting from <nStart> and continues until <nCount> elements or all array elements have been evaluated (i.e. processed).
The code-block receives two argument values:
1) the current element being evaluated (value may be of whatever type)
2) the numeric position (index) of that element into the array.
Please note that in case the <nCount> exceeding the array elements the function does not issue any kind of 'out of range' error (practically, it means that the number of evaluations may not necessarily be equal to <nCount>). This behavior stands also for other array functions.
Assigns the value of <xValue> to the <nCount> elements, beginning at position <nStart>. Multi-dimensional arrays cannot be filled using 'AFill()'. Since Arrays (and Objects) are always passed by reference, the return value is the same as the first parameter.
Inserts a new element at <nPosition> into the array <aArray>. All subsequent elements are shifted down by one position so that the last element is lost.
The number of elements remain unchanged. See hb_AIns() which allows auto-sizing of array.
Returns an array dimensioned according to the passed parameters.
All elements of the array contain the value NIL.
Search into <aArray> for <xSearch> value starting from <nStart> up to <nCount>.
Returns the position of element that matches the searched value or 0 if no match is found.
Dynamically increases or decreases the size of <aArray> to <nLength> elements.
When the array is enlarged, new elements are added to the end of <aArray> and are initialized with NIL.
When the number of elements is decreased, elements are removed from the end of <aArray> and their values are lost.
Returns reference to sized array.
Sorts an array entirely or partially. Usage of the code block <bSort> is mandatory when the array is multidimensional, otherwise sorting won't be possible.
The code-block, during the sorting process, receives two elements as block parameters and shall return .T. when they're in order. Example: ASort( aArray, {|x,y| x>y} )
Returns the value stored in the last element of <aArray>.
Deletes the value of <nElement> of array <aArray>, moves all the following values to the previous position, and assigns the last element a NIL value. Unlike the legacy ADel() function, hb_ADel() provides a third <lAutoSize> parameter which if specified .T. then the last array element is discarded and _the size of array is decreased by one_, otherwise if <lAutoSize> is .F. or not passed at all, the size of array remains unchanged.
Inserts <uValue> in the <nPos> position of the array, moving all the items to the next position. If <lAutoSize> is .T., a new element will be added, making room for the previous last element, else the size of <aArray> won't change and the last item of <aArray> will be lost.
Converts array into list of items which can be used as function parameters, array-values or array-indexes in the same way as ... operator.
Scans the array <aArray> (left to right) trying to locate the <SearchValue>, which can be a simple value or a code block.
Scanning starts either from the 1st or <nStart> element of the <aArray> and continues up to the next <nCount> elements or up to the last element of the array, if no <nCount> specified. When the logical flag <lExact> is specified, overrides the _SET_EXACT setting, which means it directly affects the exactness of comparison.
The function returns the numeric position of the first located element inside the array or 0 (zero), if no matching element found.
Returns an array filled with all individual tokens of given <cString> string, that is, all the separate sub-strings that are delimited by either <cDelimiter> or by EOL (end of line) if (instead of <cDelimiter>) <lEOL> has been passed and evaluates to .T.
If neither <cDelimiter> nor <lEOL> specified, then as delimiter is used, by default, an empty space (ASCII char 32).
If <lSkipStrings> is .T. (default=.F.), the quoted sub-strings (if any, inside cString) are not tokenized (i.e. are not searched for <cDelimiter>).
If <lDoubleQuoteOnly> is .T. only the double quote " is considered as a quote sign. This argument is meaningful only when <lSkipStrings>=.T.
Determines if <xExp> evaluates to an array value (valtype "A").
Determines if the length of <xExp>, when is a string, an array or a hash, is zero ( Len() == 0 ).
Scans (right to left) for <uValue> into <aArray> and returns <nPosition> of found or <zero> if nothing found.
It's same to hb_AScan(...) but it starts scanning reversely, from right to left (or bottom to top.)
Scans (right to left) for <uValue> into <aArray> and returns <nPosition> of found or <zero> if nothing found.
It's same to hb_AScan(...) but it starts scanning reversely, from right to left (or bottom to top.)