home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / dongrovs.zip / mr2tag.cmd < prev    next >
OS/2 REXX Batch file  |  1996-10-16  |  2KB  |  65 lines

  1. /* ********************************* */
  2. /*   By: Jetnick Enterprise          */
  3. /*       Don E. Groves, Jr.          */
  4. /*   Contact Information:            */
  5. /*     E-mail: jetnick@erols.com     */
  6. /*        CIS: 71310,3702            */
  7. /* Date: 22 Sep 1996                 */
  8. /* ********************************* */
  9.  
  10. /* comment to be forward */
  11. /*  Under Object-REXX and Classic-REXX never load RexxUtil.DLL functions */
  12. /* with 'RxFuncAdd' (except for 'SysLoadFuncs'). As some of them don't */
  13. /* work correctly when you do so. */
  14. /* call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree' */
  15. /*  I also recomend that 'SysDropFuncs' NEVER BE CALLED */
  16.  
  17. /* Completely rewritten for Object-REXX */
  18.  
  19. tagmarker      = '****->INSERT TAG HERE<-****'
  20. DateTimeMarker = '****->INSERT DATETIME<-****'
  21. RtCode = 8
  22. Argv = .ARRAY_CLI~of(ARG(1), .false, .false) /* parse the arguments */
  23. IF Argv~items > 0
  24. THEN DO
  25.    msg_filename = Argv[1]  /* get the FileName */
  26.    msgSt = .OutTextStream~new(msg_FileName)
  27.    msgSt~OPEN('READ')
  28.    msgA = msgSt~MakeArray
  29.    msgSt~CLOSE
  30.    su = msgA~Supplier
  31.    found = .list~NEW
  32.    dtno = .nil
  33.    do while su~Available
  34.       IF su~ITEM == tagmarker
  35.       THEN found~insert(su~index)
  36.       ELSE IF su~ITEM == DateTimeMarker
  37.       THEN dtno = su~INDEX   /* find the last DateMarker only */
  38.       su~NEXT
  39.    END
  40.    if Found~items > 0 | dtno \= .nil
  41.    THEN DO
  42.       su = Found~Supplier
  43.       do while su~Available
  44.          msgA[su~item] = .GetTagLine~LineFeed('ooRexx Mr2Tag -> ')
  45.          su~NEXT
  46.       end
  47.       IF dtNo \= .nil
  48.       THEN msgA[dtNo] = 'Tagged on:'~' '(.MyTimeZone~MakeString)
  49.       msgSt~OPEN('WRITE REPLACE')
  50.       msgSt~WriteList(msgA)
  51.       msgSt~CLOSE
  52.    END
  53.    RtCode = 0
  54. END
  55. return RtCode
  56.  
  57. /* ********************************* */
  58. ::requires TextStream
  59. ::requires GetTagLine
  60. ::requires Array_Cli
  61. ::requires MyTimeZone
  62.  
  63. /* ********************************* */
  64.  
  65.