This function implements an extended version of the LIKE operation in the Express language as defined in section 12.2.5 in ISO 10303-11:1994(E) : The EXPRESS Language Reference Manual. The extension is that optionally the operation can do case insensitive comparison.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiLike(SdaiString operand1,
SdaiString operand2,
SdaiInteger options,
SdaiLogical *result);
Arguments:
operand1 |
The target string (left operand). |
operand2 |
The pattern string (right operand). |
options |
Specifies the options of the operation |
result |
Address of a SdaiLogical variable that receives the result of the operation. |
Option Description
CASE_SENSITIVE |
Characters are compared case sensitive. |
CASE_INSENSITIVE |
Characters are compared case insensitive. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
SdaiAppInstance currInst;
SdaiLogical result;
EdmiError rstat;
. . .
if (rstat = edmiLike ("\AAAA", "
A?AA", CASE_SENSITIVE, &result)) {
/* Error in operation */
printf("\nError: %s in edmiLike\n",
edmiGetErrorText(rstat));
goto error;
}
if (result == sdaiTRUE) {
printf("\nString: %s matches pattern: %s", "
AAAA", "\\\\A?AA");
}
. . .