public void format(final String s, int n)
    {
      String text = s;
      while (text.length()>0)
      {
        String rest = text;
        int i = text.indexOf('\n');
        if (i>=0)
        {
          rest = text.substring(0,i).trim();
          text = text.substring(i+1,text.length());
        }
        else
          text = "";

        String pfx = "//  ";
        int k = n;
        while (rest.length()>=k)
        {
          i = rest.lastIndexOf(' ',k);
          if (i>=0)
          {
            line(pfx + rest.substring(0,i));
            rest = rest.substring(i+1,rest.length());
          }

          else
          {
            line(pfx + rest.substring(0,k));
            rest = rest.substring(k,rest.length());
          }

          pfx = "//    ";
          k = n-2;
        }
        line(pfx + rest);
      }
    }