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

  1. /* Off-line Time/Date Stamp Modifyer for MR/2 ICE */
  2. /* ********************************* */
  3. /*   By: Jetnick Enterprise          */
  4. /*       Don E. Groves, Jr.          */
  5. /*   Contact Information:            */
  6. /*     E-mail: jetnick@erols.com     */
  7. /*        CIS: 71310,3702             */
  8. /* Date: 27 Aug 1996                  */
  9. /* ********************************** */
  10. /* Based very losely on the script */
  11. /* TimeZone.cmd by: */
  12. /* William H. Geiger III */
  13. /* Geiger Consulting */
  14. /* whgiii@amaranth.com */
  15. /* ********************************** */
  16. say time()
  17.  
  18.  /* Requires */
  19. parse source . . myname
  20. wrk = myname~substr(1,myname~lastpos('\'))
  21. tz1File = wrk~''('tz1File.cmd')
  22. tz1Folder = wrk~''('tz1Folder.cmd')
  23. call (tz1File)
  24. call (tz1Folder)
  25. elsp_counter = .Elasp_Time~NEW
  26.  
  27. RtCode = 1
  28. Argv = .ARRAY_CLI~of(ARG(1), .false, .false) /* parse the arguments */
  29. if Argv~items > 0
  30. THEN DO
  31.    user_name = Argv[1]     /* get filename */
  32.    SAY 'user_name=' user_name
  33.    xf = .ndx_File~new(user_name~''("\mr2i.ndx"))
  34.    if xf~exist
  35.    THEN DO
  36.       if Argv~items > 1
  37.       THEN fix = Argv[2]
  38.       else fix = ''
  39.       if fix=='fix'
  40.       then worker = .FixTimeZone~new
  41.       else worker = .DoTimeZone~new
  42.       xf~Doer(worker)   /* do the root folder.ndx */
  43.       drop xf
  44.  
  45.       xf = Stream~new(user_name~''("\folders.ndx"))
  46.       root_folder = xf~MakeArray~supplier
  47.       xf~close
  48.       drop xf
  49.       do while root_folder~available
  50.          /* get folder name */
  51.          parse value root_folder~item with v1 '' . '' v3 '' . '' .
  52.          folder = user_name~''('\')~''(v3)
  53.          say folder 'Long name is "'~''(v1)~''('"')
  54.          .ndx_File~new(folder~''("\folder.ndx"))~Doer(worker)
  55.          root_folder~next
  56.       end
  57.       RtCode = 0
  58.    END
  59.    ELSE DO
  60.       SAY 'ERROR:'~' '(user_name)~' '('root MR2I.NDX file not found.')
  61.    END
  62. end
  63. say elsp_counter
  64. return RtCode  /* set exitcode to zero if everthing Ok */
  65.  
  66. /* ************* */
  67. /* I could use the following, but then the support files would have to */
  68. /* be in the current directory or along the PATH. */
  69. /* ::requires Tz1File   */
  70. /* ::requires Tz1Folder */
  71. /* ************* */
  72.  
  73.  
  74.