home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / ircii30.zip / script / repeat < prev    next >
Text File  |  1994-07-30  |  298b  |  21 lines

  1. # Use a simply while loop to repeat a command.
  2. alias repeat {
  3.     @ rep.cnt = [$0]
  4.     while ( rep.cnt > 0 )
  5.     {
  6.         $1-
  7.         @rep.cnt = rep.cnt - 1
  8.     }
  9.     ^assign -rep.cnt
  10. }
  11.  
  12. # Do the samn thing with recursion  See.. SET MAX_RECURSIONS
  13. alias recrepeat {
  14.     if ([$0] > 0)
  15.     {
  16.         $1-
  17.         recrepeat ${[$0] -1} $1-
  18.     }
  19. }
  20.     
  21.