ARRAY ALEN()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Return the number of array elements


SYNONYM

api_array_alen()


SYNOPSIS

#include "dbapi.h"
 
int	ARRAY_ALEN(string)
 
<input parameters>
char	*string;		/* Address of a buffer containing the name of a Recital array	*/
 
<output parameters>
none


DESCRIPTION

The ARRAY_ALEN() function will return the number of elements in the specified Recital array.

NOTE: Recital array elements start at 1 and not 0 as in 'C'.


EXAMPLE

The following example returns the number of elements in the given array.

Example Recital program:

declare value[20]
declare new_value[get_alen("value")]
return

Example 'C' function:

#include "dbapi.h"
 
dbapi_array_alen ()
{
    int	numarray;
 
    if (_parinfo(1) == API_ATYPE ) {
       numarray = ARRAY_ALEN(_parc(1));
    } else {
       numarray = 0;
    }
 
    _retni(numarray);
}


SEE ALSO

_parinfa(), ALENGTH(), ISARRAY(), ARRAY_DEFINE(), ARRAY_LOOKUP(), ARRAY_UPDATE()