CMATCH
ANSI, NCHAR
The CMATCH instruction compares a single character in the source string to a single character in the destination string. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
source
Required. A previously defined Character String Variable, a National Character String Variable, a single character Literal, a National Character String Literal, a {ctrl} representation, or an EQUATEd value that is compared to the {dest} value.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
dest
Required. A previously defined Character String Variable, a National Character String Variable, a single character Literal, a National Character String Literal, a {ctrl} representation, or an EQUATEd value that is compared to the {source} value.
Flags Affected: EOS, LESS, ZERO
Note the following:
The Form Pointed character in the source string or the character specified by {source} is compared to the Form Pointed character in the destination string or the literal specified by {dest}. The contents of both operands remain unchanged.
If the two characters are equal, the EQUAL (or ZERO) Condition Flag is set.
If the two characters are not equal, the instruction makes the following calculation
based on the hexadecimal value of the two characters
X = DESTINATION HEX VALUE - SOURCE HEX VALUE
If X is negative, the LESS Condition Flag is set.
If either operand is a Null String, the EOS Condition Flag is set.
Since CMATCH only accepts a single character literals, no forcing character is required or allowed in the literal. To match for a literal hash mark, use a single character literal parameter ("#").
See Also: Example Code, MATCH, Character String Instructions
![]() |