      subroutine getsts
      include 'screen.inc'
      integer*2 irowt,nlines,iopt
      logical yesno
      external yesno
c
 15   call cls
      stastr(1)='PERP'
      stastr(2)='SIGH'
      stastr(3)='ANGL'
      do 5 iopt=1,mxstat
 5       statop(iopt)=0
c
c   get data analysis options
c
      irow=1
      icol=15
      line='Select from the following data status options by'
      call scrlin
      irow=irow+1
      line='moving the cursor with the up and down arrow keys,'
      call scrlin
      irow=irow+1
      line='and hitting a carriage return to select a particular'
      call scrlin
      irow=irow+1
      line='option, or to un-select an option already selected.'
      call scrlin
      irow=irow+2
      irowt=irow
      icol=10
      line='PERP - perpendicular distances are provided in input data.'
      call scrlin
      irow=irow+2
      line='SIGH - sighting distances are provided in input data.'
      call scrlin
      irow=irow+2
      line='ANGL - sighting angles are provided in input 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=mxstat*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.mxstat) then
            statop(iopt)=1-statop(iopt)
            if (statop(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,mxstat
 75      nlines=nlines+statop(iopt)
      if (nlines.eq.0 .or. nlines.gt.mxstat) 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,mxstat
         if (statop(i).eq.1) then
            irow=irow+1
            line=stastr(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,mxstat
         if (statop(i).eq.1) then
             line(iopt:iopt+3)=stastr(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
