[BACK]Return to printSVector.ccc CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097 / lib

File: [local] / OpenXM / src / k097 / lib / Attic / printSVector.ccc (download)

Revision 1.1.1.1 (vendor branch), Fri Oct 8 02:12:15 1999 UTC (24 years, 8 months ago) by maekawa
Branch: OpenXM
CVS Tags: maekawa-ipv6, RELEASE_20000124, RELEASE_1_1_3, RELEASE_1_1_2, ALPHA
Changes since 1.1: +0 -0 lines

o import OpenXM sources

Println("printSVector.ccc 1996, 8/17");



def printSVector(keys) {
  local i,j,n,max,width,m,k,kk,tmp0;
  n = Length(keys);
  max = 0;
  for (i=0; i<n; i++) {
     if (Length(keys[i]) > max) {
        max = Length(keys[i]);
     }
  }
  /* Println(max); */
  max = max+3;
  width = 80;
  m = 0;
  while ((m*max) < 80) {
     m = m+1;
  }
  k = 0; kk = 0;
  for (i=0; i<n; i++) {
    Print(keys[i]); kk = kk+1;
    k = k+Length(keys[i]);
    tmp0 = max-Length(keys[i]);
    for (j=0; j < tmp0 ; j++) {
       k = k+1;
       if (kk < m) {Print(" ");}
    }
    if (kk >= m) {
      kk = 0; k=0; Ln();
    }
  }
  Ln();
   
  /* Println(keys); */
}