home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / yatla1.zip / yatla.cmd < prev    next >
OS/2 REXX Batch file  |  1997-03-03  |  1KB  |  60 lines

  1. /* YATLA/2 v1.1 (now with X-mailer)     */              
  2. /* REXX tagline genarator for PmMail     */
  3. /* By Sam Herr                */
  4.  
  5. call rxfuncadd 'sysloadfuncs', 'rexxutil', 'sysloadfuncs'
  6. call sysloadfuncs
  7.  
  8. /* get message to add tagline to    */
  9. parse arg file
  10.  
  11. /* get the pmmail directory             */
  12. dir=directory()
  13. parse var dir drv':'path
  14. drv=drv':'
  15.  
  16. /* read in info from the .ini file      */
  17. /* close the .ini file                  */
  18. tldrv=linein(yatla.ini)
  19. tlpath=linein(yatla.ini)
  20. mailer=linein(yatla.ini)
  21. rc=lineout(yatla.ini)
  22.  
  23. /* go to the tagline dir                */
  24. '@'tldrv
  25. '@cd' tlpath
  26.  
  27. /* randomly decide which tagfile to use */
  28. rc=sysfiletree('*.tag',tags,O)
  29. ran=random(1,tags.0)
  30. tagfile=tags.ran
  31.  
  32. /* genirate a random number        */
  33. /* and close the tagline file        */
  34. num=linein(tagfile, 1, 1)
  35. readpos=random(2,num)
  36. rc=lineout(tagfile)
  37.  
  38. /* read in the random tagline        */
  39. tagline=linein(tagfile,readpos,1)
  40.  
  41. /* return to the pmmail dir             */
  42. '@'drv
  43. '@cd' path
  44.  
  45. /* get the numer of lines in the file    */
  46. rc=linein(file,1,0)
  47. return=1
  48. x=0
  49. do until return=0
  50.         return=lines(file)                
  51.         xmail=linein(file)
  52.         x=x+1
  53. /*         if POS('X-Mailer:',xmail) >< 0 then rc=lineout(file,"X-Mailer: "mailer"             ",x) */
  54. end
  55.  
  56. /* put the tagline on the last line    */
  57. /* and close the file            */
  58. rc=lineout(file,tagline,x)
  59. rc=lineout(file,,x+1)
  60.