home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / guestbk.zip / getcomments.cmd < prev    next >
OS/2 REXX Batch file  |  1996-01-18  |  922b  |  41 lines

  1. /*REXX - Create an html comments file from guestbook form */
  2.  
  3. call syssleep 10
  4.  
  5. comments_header = "d:\gopher\comments.hdr"
  6. comments_text = "d:\gopher\cgi-bin\comments.txt"
  7. comments_trailer = "d:\gopher\comments.trlr"
  8. comments_html = "d:\gopher\docs\comments.html"
  9. crlf = "0d0a"x
  10. working_dir = "d:\gopher"
  11. message = ""
  12.  
  13. newq = RxQueue("create")
  14. oq = RxQueue('set', newq)
  15.  
  16. call Directory working_dir
  17.  
  18. do while lines(comments_header)
  19.    message = message || linein(comments_header) || crlf
  20. end
  21.  
  22. do while lines(comments_text)
  23.    push linein(comments_text)
  24. end
  25.  
  26. do while queued() > 0
  27.    parse pull queue_entry
  28.    message = message || queue_entry || crlf
  29. end
  30.  
  31. do while lines(comments_trailer)
  32.    message = message || linein(comments_trailer) || crlf
  33. end
  34.  
  35. call SysFileDelete(comments_html)
  36. rc = lineout(comments_html, message)
  37. rc = lineout(comments_html)
  38. call RXQueue "delete", newq
  39.  
  40. exit
  41.