home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / assist11.zip / ADD2FILE.CMD next >
OS/2 REXX Batch file  |  1999-04-25  |  673b  |  36 lines

  1. /****************************************/
  2. /* Assistant/2     (c) 1998 Hinnerk Becker   */
  3. /****************************************/
  4. /* This macro adds the selected text to a file   */
  5. /****************************************/
  6.  
  7.  
  8. file = ARG(1)
  9.  
  10.  
  11. /* Read text from STDIN */
  12.  
  13.  
  14.  
  15. text = ''
  16. count = CHARS()
  17. DO WHILE count > 0
  18.  
  19.  c = CHARIN(STDIN)
  20.  text = text||c
  21.  count = CHARS()
  22. END
  23.  
  24. /* Write text to file */
  25.  
  26. dt = DATE()' - 'TIME()
  27. line = "***************************************************************************"
  28.  
  29. res = LINEOUT(file,line);
  30. res = LINEOUT(file,dt);
  31. res = LINEOUT(file,line);
  32. res = LINEOUT(file,text)
  33.  
  34. call beep 262,250
  35.  
  36. EXIT