nchar Function

public pure function nchar(i) result(chara)

nchar means 'negative char'.

Arguments

Type IntentOptional Attributes Name
integer(kind=int8), intent(in) :: i

Return Value character(len=1)


Source Code

   pure function nchar(i) result(chara)
      implicit none
      integer(int8), intent(in) :: i
      character(1) :: chara

      if (i < 0) then
         chara = char(i+256)
      else
         chara = char(i)
      end if
   end function nchar