Read a value as integer(int64), strictly.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(cli_t), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | name |
Long name of a declared entry. |
||
| integer(kind=int64), | intent(out) | :: | value |
Parsed value; zero when the conversion failed. |
||
| type(error_t), | intent(inout), | optional | :: | err |
Set on an undeclared name or an unparsable value. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(error_t), | private | :: | local | ||||
| type(string_type), | private | :: | text |
subroutine cli_get_int64(this, name, value, err) !! Read a value as `integer(int64)`, strictly. class(cli_t), intent(in) :: this character(len=*), intent(in) :: name !! Long name of a declared entry. integer(int64), intent(out) :: value !! Parsed value; zero when the conversion failed. type(error_t), intent(inout), optional :: err !! Set on an undeclared name or an unparsable value. type(string_type) :: text type(error_t) :: local value = 0_int64 call this%get_string(name, text, err) if (present(err)) then if (err%has_error()) return else if (this%find(name) == 0_default_int) return end if call parse_int(char(text), value, local) if (local%has_error()) then call fail(err, ERROR_PARSE, "pic_cli: "//name//" is not an integer: "//char(text)) end if end subroutine cli_get_int64