CMPC - EIS string compare.

Alternate Entry Name: .CMPC

Usage:

B:
   diff = cmpc( string1, pos1, string2, pos2, length
          [, length2, fill, type ] );
C:
   int cmpc(const char *string1, int pos1,
            const char *string2, int pos2,
            [ int length, int length2, int fill,
              int type] );

Where:

string1
is a pointer to a string.
pos1
is a character offset into "string1".
string2
is a pointer to another string.
pos2
is a character offset into "string2".
length
is the number of characters to be compared.
length2
is the number of characters in "string2" to be compared against "length" characters from "string1", the shorter string being padded out with the character in "fill". If "length2" is not specified, the default value is "length".
fill
is a single character with which the shorter string is to be padded. If "fill" is not specified, the shorter string will be padded with blanks.
type
is one of 4, 6, or 9, indicating how many bits per character there are in the two strings. The default is nine bits per character, signifying ASCII characters.

Description:

CMPC uses the EIS "cmpc" instruction to compare the given strings. CMPC returns a zero if the two strings are the same, a -1 if string1<string2, and a +1 if string1>string2.

Note:

The functions EQUAL and COMPARE should be used whenever possible.

See Also:

expl b lib compare

expl b lib equal

Copyright © 1996, Thinkage Ltd.