isBase Subroutine

public pure subroutine isBase(input, base, output, error)

Check if the input string is a valid signed integer string of the numbering system with the radix that is defined by the value of the argument base.

This subroutine ignores leading and trailing whitespaces.

This subroutine support numbering system with radix from 2 to 36.

This subroutine considers an error to has occurred when the value of the argument base is smaller than 2 or larger than 36.

Arguments

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

A string.

integer(kind=k_int32), intent(in) :: base

An int32 value that define the radix.

logical, intent(out) :: output

.TRUE. if the input string is a valid signed integer string of the defined numbering system. .FALSE. if the input string is empty(only spaces), 0 length, or is not a valid signed integer string of the defined numbering system.

logical, intent(out) :: error

A value of .TRUE. on error. Otherwise, a value of .FALSE..