home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / bit / listserv / scriptl / 44 next >
Encoding:
Text File  |  1992-07-21  |  985 b   |  28 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!wupost!psuvax1!psuvm!auvm!PUCC.BITNET!Q2201
  3. Message-ID: <SCRIPT-L%92072113195787@RICEVM1.RICE.EDU>
  4. Newsgroups: bit.listserv.script-l
  5. Date:         Tue, 21 Jul 1992 14:18:52 EDT
  6. Sender:       "IBM vs Waterloo SCRIPT discussion group"
  7.               <SCRIPT-L@RICEVM1.BITNET>
  8. From:         "Hannah Appl. Kaufman" <Q2201@PUCC.BITNET>
  9. Subject:      Waterloo Script string functions
  10. Lines: 16
  11.  
  12. I am trying to create a padded string with leading zeros using
  13. Waterloo Script 88.1 functions and am having no luck.  The
  14. simplest would be the &'right function -
  15.  
  16. .sr num = 11
  17. .sr newnum = &'right(&num,7,'0')
  18.  
  19. However, this gives me &newnum as 11, left-justified with no zeros.
  20. What I want is 0000011 if the number is 11, and 0000111 if the
  21. number has 3 digits, etc.
  22.  
  23. I've tried using the &'overlay and &'insert functions with similar
  24. problems.  Anyone know a solution?
  25.  
  26. Thanks,
  27. Hannah Kaufman
  28.