]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
1 | .. |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. index:: VERIFY, string, find missing set | |
7 | ||
8 | .. _verify: | |
9 | ||
10 | VERIFY --- Scan a string for characters not a given set | |
11 | ******************************************************* | |
12 | ||
13 | .. function:: VERIFY(STRING, SET, BACK , KIND) | |
14 | ||
15 | Verifies that all the characters in :samp:`{STRING}` belong to the set of | |
16 | characters in :samp:`{SET}`. | |
17 | ||
18 | :param STRING: | |
19 | Shall be of type ``CHARACTER``. | |
20 | ||
21 | :param SET: | |
22 | Shall be of type ``CHARACTER``. | |
23 | ||
24 | :param BACK: | |
25 | (Optional) shall be of type ``LOGICAL``. | |
26 | ||
27 | :param KIND: | |
28 | (Optional) An ``INTEGER`` initialization | |
29 | expression indicating the kind parameter of the result. | |
30 | ||
31 | :return: | |
32 | The return value is of type ``INTEGER`` and of kind :samp:`{KIND}`. If | |
33 | :samp:`{KIND}` is absent, the return value is of default integer kind. | |
34 | ||
35 | Standard: | |
36 | Fortran 90 and later, with :samp:`{KIND}` argument Fortran 2003 and later | |
37 | ||
38 | Class: | |
39 | Elemental function | |
40 | ||
41 | Syntax: | |
42 | .. code-block:: fortran | |
43 | ||
44 | RESULT = VERIFY(STRING, SET[, BACK [, KIND]]) | |
45 | ||
46 | Example: | |
47 | .. code-block:: fortran | |
48 | ||
49 | PROGRAM test_verify | |
50 | WRITE(*,*) VERIFY("FORTRAN", "AO") ! 1, found 'F' | |
51 | WRITE(*,*) VERIFY("FORTRAN", "FOO") ! 3, found 'R' | |
52 | WRITE(*,*) VERIFY("FORTRAN", "C++") ! 1, found 'F' | |
53 | WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.) ! 7, found 'N' | |
54 | WRITE(*,*) VERIFY("FORTRAN", "FORTRAN") ! 0' found none | |
55 | END PROGRAM | |
56 | ||
57 | See also: | |
58 | :ref:`SCAN`, | |
3ed1b4ce | 59 | :ref:`index-intrinsic` |