OS/2 Procedures Language 2/REXX


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


VERIFY




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

VERIFY returns a number indicating whether string is composed only of 
characters from reference. VERIFY returns the position of the first 
character in string that is not also in reference.  If all the characters 
were found in reference, 0 is returned. 
The third argument, option, can be any expression that results in a string 
starting with N or M that represents either Nomatch (the default) or 
Match.. Only the first character of option is significant and it can be in 
uppercase or lowercase, as usual. If Nomatch is specified, the position of 
the first character in string that is not also in reference is returned. 0 
is returned if all characters in string were found in reference. If Match 
is specified, the position of the first character in string that is in 
reference is returned, or 0 is returned if none of the characters were 
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. 
VERIFY always returns 0 if string is null or if start is greater than 
LENGTH(string). If reference is null, VERIFY returns 0 if you specify 
Match; otherwise, 1 is returned. 
Here are some examples: 

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('AB3CD5','1234567890','M',4)    ->    6
  

Inf-HTML End Run - Successful