      subroutine getval (nop, key, value, lenval)
      
      character*(*) key, value
      integer*2 nop, lenval
      character*40 prompt      

      nop = nop + 1
      call getarg (nop, value, lenval)
      do while (lenval .le. 0)
        prompt = key
        call caryon (' '//prompt(:len_trim(prompt))//' : ', value)
        lenval = len_trim(value)
      end do
      return
      end

