Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : PATTERN_MATCH

PATTERN_MATCH
Determines whether a string matches a given pattern. (F)
Invocation
PATTERN_MATCH(string, pattern)
 
The sequence of characters, which could contain the special characters asterisk (*) and question mark (?)
Usage Notes
Example
The following rule illustrates the use of PATTERN_MATCH:
The rule checks to see if the commands SELECT or DELETE, or any abbreviation of these commands, such as SEL or DEL, are valid.
If the command is a valid SELECT or DELETE command, the appropriate rule is called.
If the command is not valid, the user gets a message on the screen (EMPSCREEN) explaining that the command is not acceptable. The following illustrates a rule using PATTERN_MATCH:

 
PROCESS_CMD(USER_COMMAND);
_ ---------------------------------------------------------------------
_ PATTERN_MATCH(USER_COMMAND, 'SEL*'); | Y N N
_ PATTERN_MATCH(USER_COMMAND, 'DEL*'); | Y N
_ ------------------------------------------------------------+--------
_ CALL SELECT_COMMAND; | 1
_ CALL DELETE_COMMAND; | 1
_ CALL SCREENMSG('EMPSCREEN', USER_COMMAND ||         | 1
- ’IS AN INVALID COMMAND');
_ ----------------------------------------------------------------------

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved