      function bin2int(s)
*
*
*
*
*
*
*
*
*
$catalog local
*
      res = 0
      for i = len(s) to 1 step -1
         res = res * 256 + seq(s[i,1])
      next i

      if len(s) = 4 then
         if res >= 128 * 256 * 256 * 256 then
            res = res - ( 256 * 256 * 256 * 256 )
         end
      end
*
      return(res)
   end
