Versions Compared

Key

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


Panel
Table of Contents

Anchor
1153684
1153684
Syntax

Parameter

Description

STRING_1

String to be compared to STRING_2.

STRING_2

String to be compared to STRING_1.

case=yes | no

Specification for whether or not the comparison is case-sensitive:

  • If set to yes, comparison is case-sensitive.
  • If set to no, comparison is not case-sensitive.


Note

If case is not used, the comparison is case insensitive.


length=length

First n characters to be compared.









Anchor
1153687
1153687
Description

Anchor
1153688
1153688
The compare command compares two strings.

Anchor
1153689
1153689
The first two parameters (STRING_1 and STRING_2) are the strings to be compared.

Anchor
1153690
1153690
The optional case parameter specifies whether the comparison is case-sensitive (yes) or case-insensitive (no). Default = no.

Anchor
1153691
1153691
If the length parameter is set, only the first n characters are compared.

Anchor
1153692
1153692
The _lastrc.result variable receives the result of the comparison:

  • If the strings match, 0 is stored in the result.
  • If the strings do not match, the index of the point at which the comparison failed is stored as the result.

Anchor
1153695
1153695
The _lastrc.message built-in variable contains MATCH if the strings are equal; it contains NO_MATCH if the strings are not equal.

Anchor
1153696
1153696

Anchor
1153698
1153698
Parameters

Parameter

Description

STRING_1

String to be compared to STRING_2.

STRING_2

String to be compared to STRING_1.

case=yes | no

Specification for whether or not the comparison is case-sensitive:

  • If set to yes, comparison is case-sensitive.
  • If set to no, comparison is not case-sensitive.

Note

If case is not used, the comparison is case insensitive.

length=length

First n characters to be compared.