chk()

Function groupExecute on clientPlatform(s)
StringNOAll

Syntax

chk(string1,string2,string3)

Description

Returns true or false depending on a character-by-character comparison of string1 with string2 and string3 using the Unicode value of each character for the basis of the comparison.

Firstly, each character of string2 is compared with the corresponding character of string1 to ensure that, for each character, string2<=string1. A character is said to be less than or greater than another character if its Unicode code is less than or greater than the Unicode code of the corresponding character. Secondly and provided string2<=string1, each character of string1 is compared with the corresponding character of string3 to ensure that, for each character, string1<=string3. If both conditions are true, that is string2<=string1 and string1<=string3 are both satisfied, the function returns true, otherwise it returns false.

Example

Calculate
 
lStatus
 as 
chk
(
'b'
,
' '
,
'c'
)

# returns true because b>' ' and b<c

 
Calculate
 
lStatus
 as 
chk
(
'B'
,
'B'
,
'C'
)

# returns true because B=B and B<C

 
Calculate
 
lStatus
 as 
chk
(
'SD04'
,
'AA00'
,
'ZZ99'
)

# returns true, since for each character of the respective strings,

# it is true that SD04>AA00 and SD04<ZZ99

# that is, S>=A, D>=A, 0>=0, 4>=0

# and S<=Z, D<=Z, 0<=9, 4<=9

 
Calculate
 
lStatus
 as 
chk
(
'SDA4'
,
'AA00'
,
'ZZ99'
)

# returns false, since in comparing the strings,

# SDA4 and ZZ99, the character A>9

 
Calculate
 
lStatus
 as 
(
chk
(
'SDA4'
,
'AA00'
,
'ZZ99'
)+1=0+1)

# returns true