ARRAY ALEN()

From Recital Documentation Wiki
Revision as of 11:56, 30 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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()