Clicky

Fortran Wiki
verify (Rev #2, changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #1 to #2: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

Verifies that all the characters in a set are present in a string.

If back is either absent or equals false, this function returns the position of the leftmost character of string that is not in set. If back equals true, the rightmost position is returned. If all characters of set are found in string, the result is zero.

Standard

Fortran 95 and later, with kind argument Fortran 2003 and later

Class

Elemental function

Syntax

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

Arguments

  • string - Shall be of type character.
  • set - Shall be of type character.
  • back - (Optional) shall be of type logical.
  • kind - (Optional) An integer initialization expression indicating the kind parameter of the result.

Return value

The return value is of type integer and of kind kind. If kind is absent, the return value is of default integer kind.

Example

program test_verify
 write(*,*) verify("fortran", "ao") ! 1, found 'f'
 write(*,*) verify("fortran", "foo") ! 3, found 'r'
 write(*,*) verify("fortran", "c++") ! 1, found 'f'
 write(*,*) verify("fortran", "c++", .true.) ! 7, found 'n'
 write(*,*) verify("fortran", "fortran") ! 0' found none
end program

See also

scan

category: (削除) Intrinsics (削除ここまで)(追記) intrinsics (追記ここまで)

Revision from April 30, 2009 17:31:08 by Jason Blevins
Forward in time (2 more) | Back in time (1 more) | See current | Hide changes | History | Rollback | View: Source | Linked from: Intrinsic procedures, scan, index

AltStyle によって変換されたページ (->オリジナル) /