ALENGTH()

From Lianjapedia
Revision as of 06:44, 11 April 2013 by Yvonne.milne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

Return the number of array elements

SYNONYM

None

SYNOPSIS

#include "lianja_api.h"
 
int	ALENGTH(order)
 
<input parameters>
int	order;		/*Placement in actual parameter list		*/
 
<output parameters>
none

DESCRIPTION

The function returns the number of elements in the array. The order specifies the actual placement in the parameter list.

EXAMPLE

The following example returns the number of elements in the array passed as the first parameter.

Example Lianja script:

Declare m_values[20]
m_anumber=anum(m_value)
return.

Example 'C' function:

#include "lianja_api.h"
 
lianjaapi_anum()
{
    int	numarray
 
    if (_parinfo(1) == API_ATYPE) {
       numarray = ALENGTH(1);
    } else {
       numarray = -1;
    }
 
    _retni(numarray);
}

SEE ALSO

_parinfa(), _parinfo(), ISARRAY(), ARRAY_ALEN(), ARRAY_DEFINE(), ARRAY_LOOKUP(), ARRAY_UPDATE(), MEMVAR_DEFINE(), MEMVAR_LOOKUP(), MEMVAR_UPDATE()