xHarbour Reference Documentation > Function Reference |
Returns the last element of an array.
ATail( <aArray> ) --> xValue
The function returns the value stored in the last element of <aArray>.
The function ATail() retrieves the value of the last element in the array named <aArray>. This function does not alter the size of the array.
See also: | [ ] (array), AEval(), AScan(), ASort(), Len() |
Category: | Array functions |
Source: | vm\arrayshb.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example shows thee ways of obtaining the last element // of an array PROCEDURE Main() LOCAL aArray := { "A", "B", "C" } // functional ? ATail( aArray ) // positive subscript ? aArray[ Len(aArray) ] // negative subscript ? aArray[-1] RETURN
http://www.xHarbour.com