CCS Standardfunction   StrCmp [INT]
 

StrCmp [INT]

String1 [Str]

String2 [Str]

Description of Function

Comparison between String1 and String2. Starting from the first character in each case, the two strings are compared character by character until a non-matching pair of characters is found or the end of one of the strings is reached. No distinction is made between upper and lower-case characters; lower-case characters are treated as upper-case. The function can return any of the following results:

0 String1 = String2

1 String1 > String2

2 String1 < String2

'<' means that String1 precedes String2 alphabetically.

Testing Points

None

Parameters

String1

First string (or variable containing the first string).

String2

Second string (or variable containing the second string).

Examples

Function call

Result

StrCmp ( A, B)

2

StrCmp ( B, A)

1

StrCmp ( AB, AB)

0

StrCmp ( AB, AB)

0

Order of characters

ASCII Value

Character

ASCII Value

Character

ASCII Value

Character

32

Space

55

7

78 (110)

N (n)

33

!

56

8

79 (111)

O (o)

34

"

57

9

80 (112)

P (p)

35

#

58

:

81 (113)

Q (q)

36

$

59

;

82 (114)

R (r)

37

%

60

<

83 (115)

S (s)

38

&

61

=

84 (116)

T (t)

39

`

62

>

85 (117)

U (u)

40

(

63

?

86 (118)

V (v)

41

)

64

@

87 (119)

W (w)

42

*

65 (97)

A (a)

88 (120)

X (x)

43

+

66 (98)

B (b)

89 (121)

Y (y)

44

,

67 (99)

C (c)

90 (122)

Z (z)

45

-

68 (100)

D (d)

91

[

46

.

69 (101)

E (e)

92

\

47

/

70 (102)

F (f)

93

]

48

0

71 (103)

G (g)

94

^

49

1

72 (104)

H (h)

95

_

50

2

73 (105)

I (i)

96

´

51

3

74 (106)

J (j)

123

{

52

4

75 (107)

K (k)

124

|

53

5

76 (108)

L (l)

125

}

54

6

77 (109)

M (m)

126

~