C Collection of code snippets by Arne Vajhøj 
C (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
      program main
      call test('123')
      call test('-123')
      call test('ABC')
      call test('123X')
      call test('')
      end
c
      subroutine test(s)
      character*(*) s
      logical*4 isint
      logical*4 isintx
      write(6,'(1x,1h",a,1h",3h : ,l1)') s,isint(s)
      write(6,'(1x,1h",a,1h",3h : ,l1)') s,isintx(s)
      return
      end
c
      logical*4 function isint(s)
      character*(*) s
      integer*4 i
      logical*4 res
      if(len(s).eq.0) then
        res = .false.
      else
        res = .true.
        do 100 i = 1,len(s)
          if((s(i:i).lt.'0').or.('9'.lt.s(i:i))) then
            if((i.ne.1).or.(s(i:i).ne.'-')) then
              res = .false.
            end if
          end if
100     continue
      end if
      isint = res
      return
      end
c
      logical*4 function isintx(s)
      character*(*) s
      integer*4 i
      logical*4 res
      if(len(s).eq.0) then
        res = .false.
      else
        res = .true.
        do 100 i = 1,len(s)
          if((ichar(s(i:i)).lt.48).or.(57.lt.ichar(s(i:i)))) then
            if((i.ne.1).or.(ichar(s(i:i)).ne.45)) then
              res = .false.
            end if
          end if
100     continue
      end if
      isintx = res
      return
      end
