The following is an example of using FNC_GetArrayElementCount to retrieve the number of present elements for a 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; ... }
The following example calls FNC_GetArrayElementCount to retrieve the number of present elements for an 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); ... }