VERIFY

Elemental Intrinsic Function (Generic):Verifies that a set of characters contains all the characters in a string by identifying the first character in the string that is not in the set.

Syntax

result = VERIFY (string, set [, back] [, kind])

string
(Input) Must be of type character.

set
(Input) Must be of type character with the same kind parameter as string.

back
(Optional; input)Must be of type logical.

kind
(Optional; input) Must be a scalar integer initialization expression.

Results:

The result is of type integer. If kind is present, the kind parameter of the result is that specified by kind; otherwise, the kind parameter of the result is that of default integer. If the processor cannot represent the result value in the kind of the result, the result is undefined.

If back is omitted (or is present with the value false) and string has at least one character that is not in set, the value of the result is the position of the leftmost character of string that is not in set.

If back is present with the value true and string has at least one character that is not in set, the value of the result is the position of the rightmost character of string that is not in set.

If each character of string is in set or the length of string is zero, the value of the result is zero.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: SCAN

Examples

VERIFY ('CDDDC', 'C') has the value 2.

VERIFY ('CDDDC', 'C', BACK=.TRUE.) has the value 4.

VERIFY ('CDDDC', 'CD') has the value zero.

The following shows another example:

 INTEGER(4) position

 position = VERIFY ('banana', 'nbc')  ! returns 2
 position = VERIFY ('banana', 'nbc', BACK=.TRUE.)
                                      ! returns 6
 position = VERIFY ('banana', 'nbca') ! returns 0