home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / m4-1.4-src.tgz / tar.out / fsf / m4 / examples / forloop.m4 < prev    next >
Text File  |  1996-09-28  |  247b  |  9 lines

  1. divert(-1)
  2. # forloop(i, from, to, stmt)
  3.  
  4. define(`forloop', `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
  5. define(`_forloop',
  6.        `$4`'ifelse($1, `$3', ,
  7.              `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
  8. divert
  9.