xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

ATail()

Returns the last element of an array.

Syntax

ATail( <aArray> ) --> xValue

Arguments

<aArray>
<aArray> is the array to retrieve the last element from.

Return

The function returns the value stored in the last element of <aArray>.

Description

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.

Info

See also:[ ] (array), AEval(), AScan(), ASort(), Len()
Category: Array functions
Source:vm\arrayshb.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe