      function int2bin(p.n,l)
*
*
*
*
*
*
*
*
*
$catalog local
*
      res = ''
      n = p.n

      if n < 0 then
         begin case
            case l = 2
               n = n + ( 256 * 256 )
            case l = 4
               n = n + ( 256 * 256 * 256 * 256 )
         end case
      end

      for i = 1 to l
         nn = mod(n,256)
         n = int(n/256)
         res := char(nn)
      next i

      return(res)
   end
