Get integer of kind 8 from the string which might contain either octal or binary number
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=8), | intent(out) | :: | lhs | |||
character(len=*), | intent(in) | :: | rhs |
subroutine int8_from_string(lhs, rhs)
!< Get integer of kind 8 from the string which might contain either octal or binary number
implicit none
integer(kind=8), intent(out) :: lhs
character(len=*), intent(in) :: rhs
character(len=len(rhs)-1) :: temp
temp = rhs(2:)
if (rhs(1:1) == 'b') then
call bin2int(lhs, temp)
else if (rhs(1:1) == 'o') then
call oct2int(lhs, temp)
end if
end subroutine int8_from_string