home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 126 / af126a.adf / Football.lzx / football / user / Cup_CloseCup.rexx < prev    next >
OS/2 REXX Batch file  |  1999-05-22  |  2KB  |  93 lines

  1. /* ***********************************************************************
  2.  
  3.    CLOSE CUP PROGRAM FOR FOOTBALL REXX SUITE
  4.   -------------------------------------------
  5.                    Copyright  Mark Naughton 1999
  6.  
  7.  
  8. Version    Date     History
  9. --------------------------------------------------------------------------
  10.  
  11.  1.0       210499   First release.
  12.  
  13. **************************************************************************
  14.  
  15. Procedure
  16. ---------
  17.  
  18. 1. Check files.
  19. 2. Setup new filename.
  20. 3. Rename files.
  21. 4. Output message.
  22.  
  23. ************************************************************************** */
  24. PARSE ARG league_file
  25.  
  26. version      = 1
  27. input_file   = '.cf'
  28. input2_file  = '.scf'
  29. input3_file  = '.cfrw'
  30. input4_file  = '.cfh'
  31. league_stuff = "Data/"league_file
  32.  
  33.  
  34.  
  35. if exists(league_stuff||input_file) = 0 then exit
  36. if exists(league_stuff||input2_file) = 0 then exit
  37. if exists(league_stuff||input3_file) = 0 then exit
  38. if exists(league_stuff||input4_file) = 0 then exit
  39.  
  40.  
  41. today = date()
  42. month = strip(word(today,2))
  43. year  = substr(word(today,3),3,2)
  44.  
  45. nleague_file = league_file"_"month||year
  46.  
  47.  
  48. f1 = league_stuff||input_file" as Data/"nleague_file||input_file
  49. address command 'c:Rename >NIL: 'f1
  50.  
  51. f1 = league_stuff||input2_file" as Data/"nleague_file||input2_file
  52. address command 'c:Rename >NIL: 'f1
  53.  
  54. f1 = league_stuff||input3_file" as Data/"nleague_file||input3_file
  55. address command 'c:Rename >NIL: 'f1
  56.  
  57.  
  58.  
  59. say
  60. say center("Close Cup",78)
  61. say "-------------------------------------------------------------------------------"
  62. say
  63. say
  64. say "  CloseCup has renamed all files with the cup-name '"league_file"' to :"
  65. say
  66. say "                    '"nleague_file||input_file"'"
  67. say "                    '"nleague_file||input2_file"'"
  68. say "                    '"nleague_file||input3_file"'"
  69. say
  70. say
  71.  
  72. if exists(league_stuff||input4_file) > 0 then do
  73.    say "  The history file, '"league_file||input4_file"' will remain the same."
  74.    say
  75.    say "  Further cups can use this same cup-name and a history of the competition"
  76.    say "  can be recorded."
  77.    say
  78.    say
  79.    say
  80.    say "  1. Import '"nleague_file||input_file"' into SETUP CUP."
  81.    say
  82.    say "  2. Change the settings and/or the teams."
  83.    say
  84.    say "  3. Save the cup as '"league_file"' and hey presto!"
  85.    say
  86.    say
  87. end
  88.  
  89. say
  90. say "-------------------------------------------------------------------------------"
  91. say
  92.  
  93. exit