VERIFY

Platform

x64, Win32, .NET

Purpose

To get the position of the first character in a string that does not appear in a given set of characters.

Class

Elemental function.

Syntax

INTEGER FUNCTION VERIFY(STRING, SET [, BACK])
CHARACTER (LEN=*) STRING,SET
LOGICAL BACK

Description

SET is of type character with the same kind type parameter as STRING. BACK is a scalar of type logical. The result is a scalar of default integer type.

Return value

Case (i): If BACK is absent or has the value false and if STRING contains at least one character that is not in SET, the value of the result is the position of the first character of STRING that is not in SET.

Case (ii): If BACK is present with the value true and if STRING contains 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.

Case (iii): The value of the result is zero if each character in STRING is in SET or if STRING has zero length.

Example

VERIFY ('ABBA', 'A') has the value 2.

VERIFY ('ABBA', 'A', BACK = .TRUE.) has the value 3.

VERIFY ('ABBA', 'AB') has the value 0.

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited