sdaiTestAttr


Returns sdaiTRUE when the specified attribute in the specified instance has an assigned value, else sdaiFALSE is returned. This operation is applicable for all attributes in all instances.
An attribute in an instance can be assigned a value by the following EDMinterface operations: sdaiPutAttr , sdaiPutAttrBN , sdaiPutAttrs , sdaiPutAttrsBN , sdaiCreateAggr , sdaiCreateAggrBN . An assigned attribute value of an Explicit attribute in an instance can be removed, i.e. unset such that the actual attribute value is indeterminate, by the sdaiUnsetAttr or sdaiUnsetAttrBN operations.
The model that holds the actual instance must be open before this function can be successfully performed.
Related functions: sdaiTestAttrBN , : sdaiPutAttr , sdaiPutAttrBN , sdaiPutAttrs , sdaiPutAttrsBN , sdaiCreateAggr , sdaiCreateAggrBN , sdaiUnsetAttr , sdaiUnsetAttrBN
Header:
#include "sdai.h"
Prototype:
SdaiBoolean sdaiTestAttr(SdaiInstance instance,
                          SdaiAttr     attribute); 
Arguments:

instance

A numeric instanceID that uniquely identifies the instance of interest in the EDMdatabase.
The instanceID is defined by a sdaiCreateInstance or a sdaiCreateInstanceBN function.

attribute

A numeric attributeID that uniquely identifies the attribute definition instance in EDMdatabase that defines the actual attribute in the instance <instance> that will be tested for an assigned value.
The attributeID is returned by the sdaiGetAttrDefinition and sdaiGetAttrDefinitionBN functions.

Returns:
A SdaiBoolean value that has the following value:
sdaiTRUE : The actual attribute in the specified instance has an assigned value.
sdaiFALSE : The actual attribute value is indeterminate, i.e. the attribute value is unset (non existing). Use sdaiErrorQuery to check for error in operation.
Examples:
SdaiInstance instance;
SdaiAttr attributeId;
SdaiErrorCode errCode;
...
if (sdaiTestAttr (instance, attributeId) == sdaiTRUE) {
/* Attribute value is set */ 
} else {
if (errCode = sdaiErrorQuery()) { 
/* Error in operation */ 
printf("\nError: %s in sdaiTestAttr \n", 
edmiGetErrorText(errCode)); 
goto error; 

}
. . .