Click or drag to resize

ATail Function (Array)

X#
Return the highest numbered element of an array.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION ATail(
	aTarget AS ARRAY
) AS USUAL
Request Example View Source

Parameters

aTarget
Type: Array
The array.

Return Value

Type: Usual
The contents of the last array element.
Remarks
ATail() returns the highest numbered element of an array.
It can be used in applications as shorthand for aArray[ALen(aArray)] when you need to obtain the last element of an array.
Examples
The following example creates a literal array and returns the last element of the array:
X#
1aArray := {"a", "b", "c", "d"}
2? ATail(aArray)            // d
See Also