      subroutine getdsc
      include 'screen.inc'
      integer*2 irowt,nlines,iopt
      integer*2 maxsop
      parameter (maxsop=4)
      character*4 sopstr(maxsop)
      integer*2 subopt(maxsop)
      logical yesno
      external yesno
      data sopstr/'LIST','CPLT','HIST','CDFP'/
c
 15   call cls
      do 5 iopt=1,maxsop
 5       subopt(iopt)=0
c
c   get data analysis options
c
      irow=1
      icol=15
      line='Select from the following descriptive output options by'
      call scrlin
      irow=irow+1
      line='moving the cursor with the up and down arrow keys, and'
      call scrlin
      irow=irow+1
      line='hitting a carriage return to select a particular option,'
      call scrlin
      irow=irow+1
      line='or to un-select an option already selected.'
      call scrlin
      irow=irow+2
      irowt=irow
      icol=10
      line='LIST - data listing and summary statistics in output.'
      call scrlin
      irow=irow+2
      line='CPLT - Crossplots of measured sighting angle vs. computed'
     1   //' sighting'
      call scrlin
      irow=irow+1
      line='       angle or sighting distance vs. sine of sighting'
     1    //' angle.'
      call scrlin
      irow=irow+1
      line='HIST - histograms of data are printed in output.'
      call scrlin
      irow=irow+2
      line='CDFP - cumulative distribution functions of '//
     1   'plots of the data.'
      call scrlin
      irow=irow+2
      line='FINISHED selecting options, and ready to proceed.'
      call scrlin
      irow=irow+1
      line='(Don''t hit Enter here until '//
     1   'satisfied with above selections'
      call scrlin
      icol=9
      call putcur(irowt,icol,ivpage,ierror)
      nlines=maxsop*2
 60   call inkey(line,keycde,nchar)
      if (keycde.eq.0) then
         continue
c     up arrow
      else if (keycde.eq.72) then
         call getcur(ivpage,irow,icol,ierror)
         irow=irow-2
         if (irow.lt.irowt) irow=irowt+nlines
         call putcur(irow,icol,ivpage,ierror)
c     down arrow
      else if (keycde.eq.80) then
         call getcur(ivpage,irow,icol,ierror)
         irow=irow+2
         if (irow.gt.irowt+nlines) irow=irowt
         call putcur(irow,icol,ivpage,ierror)
c     carriage return, meaning this area is selected.
      else if (keycde.eq.28) then
         call getcur(ivpage,irow,icol,ierror)
         iopt=(irow-irowt)/2+1
         if (iopt.le.maxsop) then
            subopt(iopt)=1-subopt(iopt)
            if (subopt(iopt).eq.1) then
               line='Selected '
               line(9:9)=char(26)
            else
               line=' '
            endif
            call putcur(irow,1,ivpage,ierror)
            call wchars(ivpage,line,9,icolor,ibckgd,1,ierror)
            call putcur(irow,icol,ivpage,ierror)
         else
c           come here when satisfied with options specified.
            go to 70
         endif
      endif
      go to 60
c   check input to see that it is valid
 70   nlines=0
      do 75 iopt=1,maxsop
 75      nlines=nlines+subopt(iopt)
      if (nlines.eq.0 .or. nlines.gt.maxsop) then
         call putcur(25,1,ivpage,ierror)
         line='No options were specified.  Re-do input.'//
     1        '    Press any key to continue.'
         call wchars(ivpage,line,70,icolor,ibckgd,1,ierror)
 76      call inkey(line,keycde,nchar)
         if (keycde.eq.0) go to 76
         go to 15
      endif
      irow=1
      icol=15
      call cls
      line='Options specified are:'
      call scrlin
      icol=20
      do 80 i=1,maxsop
         if (subopt(i).eq.1) then
            irow=irow+1
            line=sopstr(i)
            call scrlin
         endif
 80      continue
      irow=irow+2
      icol=5
      line='Are these options OK and ready to proceed?'
      if (.not. yesno(0)) go to 15
      line=' '
      line(1:1)='*'
      iopt=2
      do 140 i=1,maxsop
         if (subopt(i).eq.1) then
             line(iopt:iopt+3)=sopstr(i)
             iopt=iopt+4
             line(iopt:iopt)=','
             iopt=iopt+1
         endif
 140     continue
      iopt=iopt-1
      line(iopt:iopt)='*'
      write(unit=iout,fmt='(a)') line(1:iopt)
      return
      end
