Convert a string to integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | str | |||
integer, | intent(out) | :: | int | |||
integer, | intent(out) | :: | stat |
ELEMENTAL SUBROUTINE str2int(str, int, stat) !! Convert a string to integer CHARACTER(LEN=*), INTENT(in) :: str INTEGER, INTENT(OUT) :: int, stat read (str, *, iostat=stat) int END SUBROUTINE str2int