      subroutine dshlin (x,y,n,dsh,gap,nsec)
c
c @(#)dshlin.f	1.1  4/3/89 
c
      integer pen
      dimension x(1),y(1),dsh(1),gap(1)
c
      if (nsec.ne.0) then
c
c     initialize
c
         k = 1
         pen = 2
         s = 0.0
         t = dsh(1)
         xmin = x(n+1)
         xinc = x(n+2)
         ymin = y(n+1)
         yinc = y(n+2)
c
c     move to first point
c
         x2 = (x(1)-xmin)/xinc
         y2 = (y(1)-ymin)/yinc
         call plot (x2,y2,3)
c
c     plot dashed line curve
c
         do 20 i = 2, n
   10       x1 = x2
            y1 = y2
            x2 = (x(i)-xmin)/xinc
            y2 = (y(i)-ymin)/yinc
            d = sqrt((x2-x1)**2+(y2-y1)**2)
            s = s+d
            if (s.ge.t) then
               x2 = x2+(x1-x2)*(s-t)/d
               y2 = y2+(y1-y2)*(s-t)/d
               call plot (x2,y2,pen)
               pen = 5-pen
               s = 0.0
               t = gap(k)
               if (pen.eq.3) go to 10
               k = mod(k,nsec)+1
               t = dsh(k)
               go to 10
            endif
            call plot (x2,y2,pen)
   20    continue
         return
      endif
      call line (x,y,n,1,0,0)
      return
      end
