hexToInt128 Function

public function hexToInt128(input, output, startpos, endpos) result(error)

Parse the input string as bits represented by hexadecimal digits to an int128 value.

This function ignores leading and trailing whitespaces.

This function return a logical value of .TRUE. if an error has occurred during parsing, or .FALSE., otherwise.

This function considers an error to has occurred:
1. If the input string only contains empty spaces.
2. If the input string have a length of zero.
3. If the value for either the startpos or endpos arguments is incorrect.
4. If the input string contains a value that is beyond the capacity of the int128 data type.
5. If the input string is not a valid hexadecimal string.

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: input

A string to be parsed as a hexadecimal string to an int128 value.

integer(kind=k_int128), intent(out) :: output

An int128 value of the input string if no error has occurred during parsing.

integer(kind=k_int32), intent(in), optional :: startpos

An int32 value of the position(inclusive) of where to start parsing.

integer(kind=k_int32), intent(in), optional :: endpos

An int32 value of the position(inclusive) of where to end parsing.

Return Value logical