ARRAY DEFINE()
From Recital Documentation Wiki
PURPOSE
Define a Recital array
SYNONYM
api_array_define()
SYNOPSIS
#include "dbapi.h" int ARRAY_DEFINE(arrayname, level, dim1, dim2) <input parameters> char arrayname; /* Address of a buffer containing the name of a Recital array */ int level; /* Declaration level of array */ int dim 1; /* Dimension value 1 */ int dim 2; /* Dimension value 2 */ <output parameters> none
DESCRIPTION
The ARRAY_DEFINE() function will define a two dimensional Recital array with number of elements specified. 'dim 1' represents the number of rows and 'dim2' represents the number of columns. If 'dim2' is zero then a one dimensional array is defined. Two dimensional arrays can be accessed as one dimensional using a single element number.
NOTE: Recital array elements start at 1 and not 0 as in 'C'.
The declaration level specifies how the array is declared and can be one of the following:
VALUE | DESCRIPTION |
---|---|
API_PRIVATE | Private to the Recital calling procedure |
API_PUBLIC | Public to all Recital higher level procedures |
EXAMPLE
The following example creates a public Recital two dimensional array called value.
#include "dbapi.h" dbapi_array_define() { int dim1; int dim2; dim1 = 10; dim2 = 20; ARRAY_DEFINE("value", API_PUBLIC, dim1, dim2); _retl(-1); }
SEE ALSO
_parinfa(), ALENGTH(), ISARRAY(), ARRAY_ALEN(), ARRAY_LOOKUP(), ARRAY_UPDATE()