Product SiteDocumentation Site

7.4.73. VERIFY


>>-VERIFY(string,reference--+----------------------------------------------+--)---><
                            +-,--+--------+--+---------------------------+-+
                                 +-option-+  +-,--+-------+--+---------+-+
                                                  +-start-+  +-,length-+

Returns a number that, by default, indicates whether string is composed only of characters from reference. It returns 0 if all characters in string are in reference, or returns the position of the first character in string that is not in reference.
The option can be either Nomatch (the default) or Match. (Only the capitalized and highlighted letter is needed. All characters following it are ignored, and it can be in uppercase or lowercase characters.) If you specify Match, the function returns the position of the first character in the string that is in reference, or returns 0 if none of the characters are found.
The default for start is 1; thus, the search starts at the first character of string. You can override this by specifying a different start point, which must be a positive whole number.
The default for length is the length of the string from start to the end of the string. Thus, the search proceeds to the end of the receiving string. You can override this by specifying a different length, which must be a non-negative whole number.
If string is null, the function returns 0, regardless of the value of the third argument. Similarly, if start is greater than LENGTH(string), the function returns 0. If reference is null, the function returns 0 if you specify Match; otherwise, the function returns the start value.
Here are some examples:

Example 7.101. Builtin function VERIFY

VERIFY("123","1234567890")             ->    0
VERIFY("1Z3","1234567890")             ->    2
VERIFY("AB4T","1234567890")            ->    1
VERIFY("AB4T","1234567890","M")        ->    3
VERIFY("AB4T","1234567890","N")        ->    1
VERIFY("1P3Q4","1234567890", ,3)       ->    4
VERIFY("123","",N,2)                   ->    2
VERIFY("ABCDE","", ,3)                 ->    3
VERIFY("AB3CD5","1234567890","M",4)    ->    6
VERIFY("ABCDEF","ABC","N",2,3)         ->    4
VERIFY("ABCDEF","ADEF","M",2,3)        ->    4