home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / v / vsnbl220.zip / TRIPLET.SNO < prev    next >
Text File  |  1991-02-14  |  468b  |  20 lines

  1. *    TRIPLET.SNO
  2. *
  3. *    Sample program from Chapter 5 of the Tutorial
  4. *
  5. * Trim input, count input lines:
  6.     &TRIM = 1
  7.     N = 0
  8.  
  9. * Read next input line, all done if End-of-File.
  10. LOOP    S = INPUT            :F(END)
  11.  
  12. * Precede with blanks to center within 80 character line:
  13.     OUTPUT = DUPL(' ', (80 - SIZE(S)) / 2) S
  14.  
  15. * Increment count, but reset to 0 every third line.
  16. * Also, output a blank line when count resets:
  17.     N = REMDR(N + 1, 3)
  18.     OUTPUT = EQ(N, 0)        :(LOOP)
  19. END
  20.