次の例では、FNC_GetArrayElementCountを使用して、1-D ARRAYに存在する構成要素の数を取得します。
void getNumAryElts ( ARRAY_HANDLE *phone_ary,
INTEGER *result,
char sqlstate[6])
{
int presElementsCount;
int lastElement[1];
/* Get the number of elements currently stored in the array. */
FNC_GetArrayElementCount((*phone_ary), &presElementsCount,
lastElement);
*result = presElementsCount;
...
}
次の例では、FNC_GetArrayElementCount toを呼び出して、n-D ARRAYに存在する構成要素の数を取得します。
void SeismicStations ( ARRAY_HANDLE *seismic_ary,
INTEGER *result,
char sqlstate[6])
{
int presElementsCount;
int lastElement[FNC_ARRAYMAXDIMENSIONS];
/* Get the number of readings(elements) of seismic_ary. */
FNC_GetArrayElementCount((*seismic_ary), &presElementsCount,
lastElement);
...
}