edmiGetAggrElement
void *edmiGetAggrElement(SdaiAggr aggrId, SdaiInteger elementIndex, SdaiPrimitiveType valueType, void *pValue);
Returns the data value in the specified aggregate element. The specified primitive type <valueType> must be the same as the actual data type in the aggregate element or a compatible data type. The primitive type sdaiSELECT can be used to get all data types. The primitive type sdaiADB can be used to get all data types except typed value. The primitive type sdaiINTEGER is compatible with sdaiREAL, and sdaiBOOLEAN is compatible with sdaiLOGICAL, hence conversion between these compatible data types will be performed when required. This operation is applicable to all aggregate types. The actual aggregate element is specified by the element index. The legal index range is as follows: For ARRAY: declared lower bound <= index <= declared upper bound. The declaration of upper bound and lower bound is found in the Express schema that defines the actual aggregate. For all other aggregate types: 0<= index < number of elements in aggregate at the invocation of this operation. The model that holds the actual aggregate must be open before this function can be successfully performed.
Arguments
Type | Name | Comment |
SdaiAggr | aggrId | A numeric aggregateID that uniquely identifies the aggregate instance in the EDMdatabase. The aggregateID is returned when the aggregate is created, or it is retrieved by a get operation. |
SdaiInteger | index | An integer that denotes the aggregate element index in the aggregate to read the data value from. The legal index range is:
|
SdaiPrimitiveType | valueType | The data type, i.e. the primitive type of the data value to be retrieved. This <valueType> must be the same or a compatible type of the primitive type of the value in the actual aggregate element. The primitive type sdaiSELECT can be used to read all data types. The primitive type sdaiADB can be used to read all data types except typed values. The primitive type sdaiINTEGER is compatible with sdaiREAL, and sdaiBOOLEAN is compatible with sdaiLOGICAL, hence conversion between these compatible data types will be performed when required. |
void | value | The variable that will hold a copy of the data value read from the actual aggregate element. The type of <value> must be the same or a compatible type of <valueType>. |
Return Value
Type | Comment |
---|---|
void | void * = address of <value> : operation successfully performed. void * = NULL: error during operation – use sdaiErrorQuery function to get error reason. |
Options
Â
Example
Â
SdaiInteger index,members; int i; SdaiAggr aggrId; SdaiInstance id; . . . members = sdaiGetAggrElement(aggrId); /* assuming aggregate is not an ARRAY, hence index start with zero */ for (i = 0; i < members; i++) { id = 0; edmiGetAggrElement(aggrId, i, sdaiINSTANCE, &id); if (! id) { /* Error in operation */ printf("\nError: %s in edmiGetAggrElement\n", edmiGetErrorText(sdaiErrorQuery())); goto error; } . . . }
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â