home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 126
/
af126a.adf
/
Football.lzx
/
football
/
user
/
FixturesLeft.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-05-22
|
3KB
|
107 lines
/* ***********************************************************************
DISPLAY FIXTURES LEFT PROGRAM FOR FOOTBALL REXX SUITE
-------------------------------------------------------
Copyright Mark Naughton 1998
Version Date History
--------------------------------------------------------------------------
1.0 140498 First release.
1.1 050599 Updated to handle odd number of times each team is
played - displays a message; but only if its not
scheduled using a schedule file.
**************************************************************************
Procedure
---------
1. Check files exist. Read '.df' file for schedule and numplay settings.
2. Open Teams.sf datafile. Get league name.
3. Search for unplayed matches and store.
4. Print the matches and exit...
************************************************************************** */
PARSE ARG league_stuff
version = 1
input_file = '.sf'
input2_file = '.df'
separator = '*'
separator2 = '**'
games. = '???'
mtch = 0
not_played = '__ __'
autosched = "*AUTOSCHD="
autos = 0
numplay = 0
oddnums = "1 3 5 7 9"
parse var league_stuff league_file
league_file = "Data/" || league_file
if exists(league_file || input_file) = 0 then exit
if exists(league_file || input2_file) = 0 then exit
if open(datafile2,league_file || input2_file,'r') then do
do while ~eof(datafile2)
line = readln(datafile2)
if pos(playeo,line) > 0 then
numplay = delstr(line,1,12)
if pos(autosched,line) > 0 then
autos = 1
end
close(datafile2)
end
else do
say
say "ERROR : (FixturesLeft)"
say
say "Cannot read '"league_file || input2_file"' datafile."
exit
end
if open(datafile,league_file || input_file,'r') then do
do while ~eof(datafile)
line = readln(datafile)
if pos(separator2,line) > 0 then
league_title = delstr(line,1,3)
if pos(not_played,line) > 0 then do
mtch = mtch + 1
games.mtch = line
end
end
close(datafile)
end
else do
say
say "ERROR : (FixturesLeft)"
say
say "Cannot open '"league_file||input_file"' for reading."
exit
end
say
say center("'"league_title"'",78)
say "-------------------------------------------------------------------------------"
say
if autos = 0 & pos(numplay,oddnums) > 0 then do
say "These fixtures will be incorrect as these teams play each other an odd"
say "number of times and FOOTBALL has to write a schedule for each team as"
say "this league is not scheduled using a schedule file."
say
end
say "Fixtures To Be Played : "mtch
say
do i=1 to mtch
say games.i
end
say
say
say "-------------------------------------------------------------------------------"
say
exit