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

  1. /* ***********************************************************************
  2.  
  3.    RESULTS PROGRAM FOR FOOTBALL REXX SUITE
  4.   ---------------------------------------
  5.                    Copyright  Mark Naughton 1996
  6.  
  7.  
  8. Version    Date     History
  9. --------------------------------------------------------------------------
  10.  1.0       270996   First release. Displays all results from 'Teams.sf'
  11.                     file.
  12.  1.1       121196   Updated to get arguments and to use '*.sflearn' to get
  13.                     a true display as '.sf' was in order. Now called as a
  14.                     component of FOOTBALL.
  15.            131196   Added checks for files - if not found, exits without
  16.                     a message.
  17.            211196   Updated and tidied the display.
  18.            190497   Added title to display.
  19.  1.2       060997   Amended to handle new Automatic Scheduling schedules.
  20.                     Removed - new program for this. Formatting needs to be
  21.                     handled properly.
  22.            151297   Tidied display.
  23.            180499   Improved match/fixture display.
  24.  
  25. **************************************************************************
  26.  
  27. Procedure
  28. ---------
  29.  
  30. 1. Check files exist.
  31. 2. Open file and print all lines without '*' with the exception of
  32.    the league name which is underlined; possibly dates as well.
  33. 3. Close file and exit.
  34.  
  35. ************************************************************************** */
  36. ARG league_file
  37.  
  38. version     = 1
  39. league_file = "Data/" || league_file
  40. input_file  = '.sflearn'
  41. separator   = '*'
  42.  
  43.  
  44. if exists(league_file || input_file) = 0  then exit
  45.  
  46. if open(datafile,league_file || input_file,'r') then do
  47.    say
  48.    say center("Display League Results",78)
  49.    say "-------------------------------------------------------------------------------"
  50.    say
  51.    do while ~eof(datafile)
  52.       line = readln(datafile)
  53.       if pos(separator,line) = 0 then do
  54.          t1 = right(strip(substr(line,1,30)),30,' ')
  55.          say t1||substr(line,31)
  56.       end
  57.       else do
  58.          if words(line) > 1 then do
  59.             say subword(line,2)
  60.             uline = ''
  61.             do i=1 to length(subword(line,2))
  62.                uline = insert('-',uline,i,1)
  63.             end
  64.             say strip(uline)
  65.          end
  66.          else
  67.             if words(line) = 1 then
  68.                say
  69.       end
  70.    end
  71.    say "-------------------------------------------------------------------------------"
  72.    close(datafile)
  73. end
  74. else do
  75.    say
  76.    say "ERROR :    (Results)"
  77.    say
  78.    say "Cannot open '"league_file||input_file"' for reading."
  79. end
  80.  
  81. exit