sdaiTestAttrBN
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: sdaiTestAttr , sdaiPutAttr , sdaiPutAttrBN , sdaiPutAttrs , sdaiPutAttrsBN , sdaiCreateAggr , sdaiCreateAggrBN , sdaiUnsetAttr , sdaiUnsetAttrBN
Header:
#include "sdai.h"
Prototype:
SdaiBoolean sdaiTestAttr(SdaiInstance instance,
SdaiString attributeName);
Arguments:
instance |
A numeric instanceID that uniquely identifies the instance of interest in the EDMdatabase. |
attributeName |
Name of the attribute in the instance specified by the <instance> argument, that will be tested for an assigned value. Attribute names are case insensitive. The attribute must be qualified with the entity name when the attribute name is not unique within the actual instance. |
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;
SdaiErrorCode errCode;
...
if (sdaiTestAttrBN (instance, "Name") == sdaiTRUE) {
/* Attribute value is set */
} else {
if (errCode = sdaiErrorQuery()) {
/* Error in operation */
printf("\nError: %s in sdaiTestAttrBN \n",
edmiGetErrorText(errCode));
goto error;
}
}
. . .