Like |
Top Previous Next |
Syntax - If <literal string> LIKE <pattern string> Where: <literal string> is a literal string or a variable containing a literal string. <pattern string> is a literal string or a variable containing a literal string. Description: This comparison operator is used to determine if a specified pattern exists within a literal string or a variable containing a literal string. This comparison returns a TRUE condition if the first string contains the pattern specified by the second string. A TRUE condition will cause EMUE to process the valid statement defined by <valid script statement>. This comparison operator can be used with either an in-line If (the original OLIE syntax) or a Block If.
Notes: If both strings are empty strings, the result of the comparison is TRUE. If one of the two strings is an empty string and the other is not empty, the result of the comparison is FALSE. Both values are treated as strings, even if one or both of the strings are numeric. This comparison operator is not case sensitive.
The LIKE comparison can be used to match strings using wildcard characters, character lists, or character ranges, in any combination. The following table identifies the characters that can be used in specifying the pattern to be used in the comparison and how they will be used when the comparison is made.
Where charlist is a list of one or more characters, enclosed in brackets ([ ]). This list can include almost any character code, including digits, and it is used to compare a single character in the <literal string> to the members of the list.
Sample: The following segment of a script reads an adhoc file to determine if there is a charge date by determining if the part of the record matches the date pattern ##/##/##. Read F REM Copy the charge date from the file. Copy ChgDateFromFile File 78 8 REM Check to see if there is a charge date for that record. If ChgDateFromFile LIKE "##/##/##" GoTo Process GoTo LoopThroughFile
:Process REM Copy the fields from the file into variables See Also:
|