Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeConfluence
EdmiError edmiLike(SdaiString  operand1,
                    SdaiString  operand2, 
                    SdaiInteger options, 
                    SdaiLogical *result); 

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:

Arguments

...


spacecharacter
TypeNameComment
SdaiString

operand1

The target string (left operand).

SdaiString

operand2

The pattern string (right operand).

  The pattern matching characters are:@ Matches any letter^ Matches any upper case letter? Matches any character& Matches remainder of string# Matches any digit$ Matches a substring terminated by a

space character or end-of-string*Matches any number of characters\ Begins a pattern escape sequence! Negation character (used with the othercharacters)

SdaiInteger

options

Specifies the options of the operation

SdaiLogical

result

Address of a SdaiLogical variable that receives the result of the operation.

The result is as follows:

  • sdaiTRUE: actual string matches specified pattern
  • sdaiFALSE: actual string does not match specified pattern
  • sdaiUNKNOWN: error in operation or at least one unset argument.

Return Value

...

Insert excerpt
US:_r_EDMInterface
US:_r_EDMInterface
nopanel
Option Description
true

Options

...

 




OptionComment

CASE_SENSITIVE

Characters are compared case sensitive.

The interpretation of the pattern matching characters are as described in <operand2> argument.

CASE_SENSITIVE is the default behavior of the LIKE operation, i.e., when none of the options CASE_SENSITIVE and CASE_INSENSITIVE are set.

CASE_INSENSITIVE

Characters are compared case insensitive.

The interpretation of the pattern matching characters are as described in <operand2> argument.

Example

...

 
Returns: A completion code of datatype EdmiError is the returned function value. The completion

Code Block

...

languagecpp
 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");

...

 
 }
 . . .

 

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "model" and parent = "6062220"