sdaiPrepend


Adds an element to a LIST aggregate. The new element will be inserted as the first element in the LIST.
The data type, i.e. primitive type of the value, and the data value of the new element to be inserted in the LIST are specified as arguments to this function.
This operation is only applicable to aggregates of type LIST owned by application instances.
The model that holds the actual aggregate must be open for write access before this function can be successfully performed.
See related functions: sdaiAppend , sdaiAdd , sdaiInsertAfter , sdaiInsertBefore , sdaiPutAggrByIndex , sdaiPutAggrByIterator
Header:
#include "sdai.h"
Prototype:
void sdaiPrepend(SdaiLIst      list,
                  SdaiPrimitive valueType,
                     ...); 
Arguments:

list

A numeric aggregateID that uniquely identifies the actual LIST aggregate in the EDMdatabase.
The aggregateID is returned when the aggregate is created or it can be retrieved by an _EDMinterface_ get operation.

valueType

The data type, i.e. the primitive type of the data value to be inserted in the actual aggregate. This <valueType> must be the same or a compatible type of the primitive type of the actual aggregate element primitive type defined in the appropriate EXPRESS schema. The primitive type sdaiSELECT can be used to write all data types. The primitive type sdaiADB can be used to write 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.

value

The data value to be inserted in the actual aggregate.

Returns:
Void - use sdaiErrorQuery function to check for error during operation.
Example:
SdaiLIst list;
SdaiErrorCode errCode;
...
sdaiPrepend(list, sdaiSTRING, "abcdef9876");
if (errCode = sdaiErrorQuery()) {
/* Error in operation */ 
printf("\nError: %s in sdaiPrepend \n", 
edmiGetErrorText(errCode)); 
goto error; 
}
. . .