
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FlexFile Reference Guide - <b>a_len()</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
A_LEN()
Return the total number of elements in an array or a specified dimension
-------------------------------------------------------------------------------
Syntax
A_LEN( <aTarget>, [<nDimension>] ) -> nCount
Arguments
<aTarget> is the array whose elements will be counted.
<nDimension> is the dimension whose elements will be counted. If
not specified, all elements in the array will be counted.
Returns
A_LEN() returns the number of elements in the array or any one
dimension of the array.
Description
A_LEN() counts the number of declared elements in an array. If a
particular dimension is supplied in <nDimension>, then only the
number of elements in that dimension will be reported.
For example, if you declare a two dimensional array with thirty
students in the first dimension and their grades on five exams in
the second, A_LEN() will report thirty elements for the first
dimension, five elements in the second dimension or one hundred
and fifty elements in the entire array.
Examples
// Use A_LEN() to scan for the total length of an array.
LOCAL ffArray
// Declare a FlexFile string array.
ffArray = A_DECLARE( 'S', 5, 8 )
? A_LEN( ffArray ) // Result: 40
// Now use to show only the length of the second dimension.
? A_LEN( ffArray, 2 ) // Result: 8
See Also: A_DECLARE() A_ADD() A_SIZE()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson