Recent

Author Topic: Reading multiple data from a TMemo  (Read 15765 times)

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: Reading multiple data from a TMemo
« Reply #30 on: April 01, 2019, 05:19:39 pm »
Could you also include the uInternet-unit?
I no think need unit uInternet. Data read from file.

I think small error howardpc. remove from project and try ?

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Reading multiple data from a TMemo
« Reply #31 on: April 01, 2019, 05:37:40 pm »
Sorry, my mistake. Just remove uInternet from the .lpr. It is not needed for the example project, a leftover from an earlier attempt whose deletion I overlooked.
In a perfect world you would unzip and test the files you offer before parting with them...
« Last Edit: April 01, 2019, 05:39:17 pm by howardpc »

madref

  • Hero Member
  • *****
  • Posts: 954
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Reading multiple data from a TMemo
« Reply #32 on: April 01, 2019, 05:46:52 pm »
Well thank you for your generous help with this.


Now it's up to em to implement it into my app.
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: Reading multiple data from a TMemo
« Reply #33 on: April 01, 2019, 05:51:57 pm »
Now it's up to em to implement it into my app.
yes use program you. html smelly and bad. Many mistake parse :'(

you program write better report and not smelly :D

madref

  • Hero Member
  • *****
  • Posts: 954
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Reading multiple data from a TMemo
« Reply #34 on: April 02, 2019, 05:35:23 am »
With this part HowardPC stores the corresponding values in the TMemo
Code: Pascal  [Select][+][-]
  1.  
  2. Type
  3.   TStr = (sBlank, sTeamA, sTeamB, sPeriode1, sPeriode2, sPeriode3, sPeriode4, sScoring, sPEN, sMin);
  4.   TTeamStr = sTeamA..sTeamB;
  5.   TPeriodStr = sPeriode1..sPeriode4;
  6.   TPenaltyKind = (pkMinor, pkMajor, pkMisc, pkGMP, pkMP, pkPS);
  7.   TPenaltyValues = array[TPenaltyKind] of Integer;
  8.   TPeriodPenValues = array[TPeriodStr] of TPenaltyValues;
  9.  
  10.  
  11.     for team := sTeamA to sTeamB do
  12.       begin
  13.         PenaltyMemo.Append(GetName(team) + #10'-------------------------------');
  14.         for period := Low(TPeriodStr) to High(TPeriodStr) do
  15.           begin
  16.             PenaltyMemo.Append('    ' + PeriodToStr(period) + #10'    ------------');
  17.             total := 0;
  18.             for penaltyKind := Low(TPenaltyKind) to High(TPenaltyKind) do
  19.               begin
  20.                 PenaltyMemo.Lines.Add('      %s: %d', [PenaltyKindToStr(penaltyKind), pp.DataArray[team][period][penaltyKind]]);
  21.                 Inc(total, pp.DataArray[team][period][penaltyKind]);
  22.               end;
  23.             PenaltyMemo.Lines.Add('      total penalties: %d'#10,[total]);
  24.           end;
  25.         PenaltyMemo.Append('');
  26.       end;
But how to store them in individual variables like:
TeamA_Minor, TeamA_Major, TeamA_Misc, etc ... and
TeamB_Minor, TeamB_Major, TeamB_Misc, etc
« Last Edit: April 02, 2019, 05:37:09 am by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Reading multiple data from a TMemo
« Reply #35 on: April 02, 2019, 10:18:01 am »
The penalty counts are already stored in the 3-dimensional TPenaltyParser.DataArray, so there is no need for duplicate variables, and it is best to calculate overall totals as needed by summing appropriate counts.

However, if you insist on duplicating variables you could do this
Code: Pascal  [Select][+][-]
  1. team_A_Minor := 0;
  2.     for period := Low(TPeriodStr) to High(TPeriodStr) do
  3.       Inc(team_A_Minor, pp.DataArray[sTeamA][period][pkMinorA]);
which would give you the total of TeamA minor penalties in a separate non-array variable. However, this bloats your project's memory footprint to no purpose, since the same data is now stored in two places. It also increases the maintenance task in future, because it may be that you overlook updating the duplicate variable and keeping it in sync with the main array which is the container that receives the data at the moment it is parsed from the text file.

madref

  • Hero Member
  • *****
  • Posts: 954
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Reading multiple data from a TMemo
« Reply #36 on: April 02, 2019, 12:35:34 pm »
No I don't want to duplicate anything, BUT I need to store them in my database.
And for storing I need to separate them AND count them together.
« Last Edit: April 02, 2019, 12:42:11 pm by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: Reading multiple data from a TMemo
« Reply #37 on: April 02, 2019, 12:58:32 pm »
No I don't want to duplicate anything, BUT I need to store them in my database.
And for storing I need to separate them AND count them together.
I not understand ?

Howardpc make try TestPenaltyParser.zip

TestPenaltyParser have TPenaltyParser have DataArray. is dimensi array. You understand dimensi array ? can read http://wiki.freepascal.org/Multidimensional_arrays and https://www.tutorialspoint.com/pascal/pascal_multi_dimensional_arrays.htm

i not understand names/values. I not know what do with to make work for you. What data is ? fussball ?

Can make TPenaltyParser add method easyextract if want. But i not know data you look so not know how do. Is difficult write to you.

madref

  • Hero Member
  • *****
  • Posts: 954
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Reading multiple data from a TMemo
« Reply #38 on: April 02, 2019, 01:25:25 pm »
Its not the difficult to understand.
The sport is called Ice Hockey
And each game that is played has a score sheet (example)
All games are manned with 2,3 or 4 referees. I am one of the supervisors to evaluate the referees.
Of these evaluations I make a report for the referees.
In this report I also need to report the scoring per period, the penalties (in minutes) per period and the total given kind of penalties (see screen dump) in my previous post.


Therefor I need to extract the data from the website (Done here)


And in this topic we are discussing the way to interpret the extracted dat.
1) extracting penalties per period per team by minutes given (2,5,10,20,25 & a penalty shot (=no minutes but to count then I set it to 50)).
2) extracting the given penalties by their time per team over the whole game. I.e. how many 2 minutes penalties were given, how many 5 minutes penalties were give, etc.

You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: Reading multiple data from a TMemo
« Reply #39 on: April 02, 2019, 02:10:11 pm »
Its not the difficult to understand.
depend how look  :)

Quote
The sport is called Ice Hockey
I Sorry, i not see you say before.

I not know Hockey. Not see any so i learn wiki and understand rule/game.

For me not know and not understand. Is wizard data  :-X

Quote
And each game that is played has a score sheet (example)
All games are manned with 2,3 or 4 referees. I am one of the supervisors to evaluate the referees.
Of these evaluations I make a report for the referees.
In this report I also need to report the scoring per period, the penalties (in minutes) per period and the total given kind of penalties (see screen dump) in my previous post.
Thank for explanation.

Quote
And in this topic we are discussing the way to interpret the extracted dat.
1) extracting penalties per period per team by minutes given (2,5,10,20,25 & a penalty shot (=no minutes but to count then I set it to 50)).
2) extracting the given penalties by their time per team over the whole game. I.e. how many 2 minutes penalties were given, how many 5 minutes penalties were give, etc.
1) make good database. Is flat ?
2) PenaltyParser.DataArray store to database
3) Query database then get data database.

Data get is problem database not Pascal.

That why i confuse. I not know you database storage (name table, name field etc). You write not important but is. No need use pascal to query. all data in DataArray ? If want can do but not smart i think.

madref

  • Hero Member
  • *****
  • Posts: 954
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Reading multiple data from a TMemo
« Reply #40 on: April 02, 2019, 02:12:54 pm »
this is the table where it is stored in:
Code: Pascal  [Select][+][-]
  1.     // tbl_Evaluatie_Referee
  2.     cSQL := '';
  3.     cSQL := 'CREATE TABLE tbl_Evaluatie_Referee (' +
  4.             'Evo_ID WORD NOT NULL PRIMARY KEY ASC, ' +
  5.             'Evo_Scheids_ID WORD, ' +
  6.             'Evo_Wed_ID WORD, ' +
  7.             'Evo_Systeem WORD, ' +
  8.             'Evo_SoortWedstrijd WORD, ' +
  9.             'Evo_Supervisor WORD, ' +
  10.             'Evo_Goal_TeamA_Per1 WORD, ' +
  11.             'Evo_Goal_TeamA_Per2 WORD, ' +
  12.             'Evo_Goal_TeamA_Per3 WORD, ' +
  13.             'Evo_Goal_TeamA_Per4 WORD, ' +
  14.             'Evo_Goal_TeamB_Per1 WORD, ' +
  15.             'Evo_Goal_TeamB_Per2 WORD, ' +
  16.             'Evo_Goal_TeamB_Per3 WORD, ' +
  17.             'Evo_Goal_TeamB_Per4 WORD, ' +
  18.             'Evo_Straf_TeamA_Per1 WORD, ' +
  19.             'Evo_Straf_TeamA_Per2 WORD, ' +
  20.             'Evo_Straf_TeamA_Per3 WORD, ' +
  21.             'Evo_Straf_TeamA_Per4 WORD, ' +
  22.             'Evo_Straf_TeamB_Per1 WORD, ' +
  23.             'Evo_Straf_TeamB_Per2 WORD, ' +
  24.             'Evo_Straf_TeamB_Per3 WORD, ' +
  25.             'Evo_Straf_TeamB_Per4 WORD, ' +
  26.             'Evo_Categorie_01 WORD, ' +
  27.             'Evo_Categorie_02 WORD, ' +
  28.             'Evo_Categorie_03 WORD, ' +
  29.             'Evo_Categorie_04 WORD, ' +
  30.             'Evo_Categorie_05 WORD, ' +
  31.             'Evo_Categorie_06 WORD, ' +
  32.             'Evo_Categorie_07 WORD, ' +
  33.             'Evo_Categorie_08 WORD, ' +
  34.             'Evo_Categorie_09 WORD, ' +
  35.             'Evo_Categorie_10 WORD, ' +
  36.             'Evo_Categorie_11 WORD, ' +
  37.             'Evo_Categorie_12 WORD, ' +
  38.             'Evo_Categorie_13 WORD, ' +
  39.             'Evo_Categorie_14 WORD, ' +
  40.             'Evo_Categorie_15 WORD, ' +
  41.             'Evo_Categorie_16 WORD, ' +
  42.             'Evo_Categorie_17 WORD, ' +
  43.             'Evo_SterkePunten TEXT, ' +
  44.             'Evo_VerbeterPunten TEXT, ' +
  45.             'Evo_Feedback TEXT, ' +
  46.             'Evo_MinorA WORD, ' +
  47.             'Evo_MinorB WORD, ' +
  48.             'Evo_MajorA WORD, ' +
  49.             'Evo_MajorB WORD, ' +
  50.             'Evo_MiscA WORD, ' +
  51.             'Evo_MiscB WORD, ' +
  52.             'Evo_GMPA WORD, ' +
  53.             'Evo_GMPB WORD, ' +
  54.             'Evo_MPA WORD, ' +
  55.             'Evo_MPB WORD, ' +
  56.             'Evo_PSA WORD, ' +
  57.             'Evo_PSB WORD' +
  58.             ')';


As you can see everything needs to be stored separately. That's how it's got to be due to other references in the database.
Evo_ID, Evo_Scheids_ID, Evo_Wed_ID & Evo_Supervisor are acquired else were and are static in the form. Thus are not changeable everything else is.
« Last Edit: April 02, 2019, 02:17:13 pm by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

madref

  • Hero Member
  • *****
  • Posts: 954
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Reading multiple data from a TMemo
« Reply #41 on: April 02, 2019, 02:22:33 pm »

2) PenaltyParser.DataArray store to database
That why i confuse. I not know you database storage (name table, name field etc). You write not important but is. No need use pascal to query. all data in DataArray ? If want can do but not smart i think.


and that is now the problem. Getting the data from the website into the database.
How I store it is not the problem. BUT getting the information from the extracted data from the website to correct/corresponding variables.
When you have the variables it's a peace of cake to store them correctly in the database through the form or directly into the database.
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: Reading multiple data from a TMemo
« Reply #42 on: April 02, 2019, 03:40:32 pm »
and that is now the problem. Getting the data from the website into the database.
Multi step:
1) get data html
2) process + get data html
3) store data database

Quote
How I store it is not the problem. BUT getting the information from the extracted data from the website to correct/corresponding variables.
I think see. You is result database, not all game data store database ?

i think you missing step not store game data to database. My think.

dataarray = array = database (maybe i not all field use and make easy example see)

Not use variables. example see.

Quote
When you have the variables it's a peace of cake to store them correctly in the database through the form or directly into the database.
No not variables. it already store in dataarray. I think you not see.

example:
Code: Pascal  [Select][+][-]
  1. function GetName(pp: TPenaltyParser; aTeam: TTeamStr): String;
  2. begin
  3.   case aTeam of
  4.     sTeamA: Exit(pp.TeamA);
  5.     sTeamB: Exit(pp.TeamB);
  6.   end;
  7. end;
  8.  
  9.  
  10. procedure WriteFlatPenal(pp: TPenaltyParser);
  11. var
  12.    // example variable use to index
  13.   fTeam   : TTeamStr;
  14.   fPeriod : TPeriodStr;
  15.   fPenalty: TPenaltyKind;
  16.   fPenaltyValue : integer;
  17.   FlatString: String;
  18. begin
  19.   for fTeam in TTeamStr do
  20.   begin
  21.     for fPeriod in TPeriodStr do
  22.     begin
  23.       for fPenalty in TPenaltyKind do
  24.       begin
  25.         // data stored array
  26.         fPenaltyValue := pp.DataArray[fteam][fperiod][fpenalty];
  27.        // easy example write but need store database then query database
  28.         WriteStr(FlatString, '"',GetName(pp,fTeam),'","', fPeriod,'","', fPenalty, '","', fPenaltyValue, '"');
  29.         WriteLn(FlatString);
  30.       end;
  31.     end;
  32.   end;
  33. end;
  34.  
  35. procedure Parse(aFilename: String);
  36. var
  37.   pp : TPenaltyParser;
  38. begin
  39.   pp := TPenaltyParser.Create(aFilename);
  40.   WriteFlatPenal(pp);
  41.   pp.Free;
  42. end;
  43.  
  44. begin
  45.   Parse('52677.txt');
  46. end.
  47.  

It write flat database:
Code: [Select]
"Microz Eaters Limburg","sPeriode1","pkMinorA","1"
"Microz Eaters Limburg","sPeriode1","pkMajorA","0"
"Microz Eaters Limburg","sPeriode1","pkMiscA","1"
"Microz Eaters Limburg","sPeriode1","pkGMPA","0"
"Microz Eaters Limburg","sPeriode1","pkMPA","0"
"Microz Eaters Limburg","sPeriode1","pkPSA","0"
"Microz Eaters Limburg","sPeriode2","pkMinorA","0"
"Microz Eaters Limburg","sPeriode2","pkMajorA","0"
"Microz Eaters Limburg","sPeriode2","pkMiscA","0"
"Microz Eaters Limburg","sPeriode2","pkGMPA","0"
"Microz Eaters Limburg","sPeriode2","pkMPA","0"
"Microz Eaters Limburg","sPeriode2","pkPSA","0"
"Microz Eaters Limburg","sPeriode3","pkMinorA","2"
"Microz Eaters Limburg","sPeriode3","pkMajorA","0"
"Microz Eaters Limburg","sPeriode3","pkMiscA","2"
"Microz Eaters Limburg","sPeriode3","pkGMPA","0"
"Microz Eaters Limburg","sPeriode3","pkMPA","0"
"Microz Eaters Limburg","sPeriode3","pkPSA","0"
"Microz Eaters Limburg","sTimeout","pkMinorA","0"
"Microz Eaters Limburg","sTimeout","pkMajorA","0"
"Microz Eaters Limburg","sTimeout","pkMiscA","0"
"Microz Eaters Limburg","sTimeout","pkGMPA","0"
"Microz Eaters Limburg","sTimeout","pkMPA","0"
"Microz Eaters Limburg","sTimeout","pkPSA","0"
"Zoetermeer Panters","sPeriode1","pkMinorA","0"
"Zoetermeer Panters","sPeriode1","pkMajorA","0"
"Zoetermeer Panters","sPeriode1","pkMiscA","0"
"Zoetermeer Panters","sPeriode1","pkGMPA","0"
"Zoetermeer Panters","sPeriode1","pkMPA","0"
"Zoetermeer Panters","sPeriode1","pkPSA","0"
"Zoetermeer Panters","sPeriode2","pkMinorA","3"
"Zoetermeer Panters","sPeriode2","pkMajorA","0"
"Zoetermeer Panters","sPeriode2","pkMiscA","0"
"Zoetermeer Panters","sPeriode2","pkGMPA","0"
"Zoetermeer Panters","sPeriode2","pkMPA","0"
"Zoetermeer Panters","sPeriode2","pkPSA","0"
"Zoetermeer Panters","sPeriode3","pkMinorA","0"
"Zoetermeer Panters","sPeriode3","pkMajorA","0"
"Zoetermeer Panters","sPeriode3","pkMiscA","0"
"Zoetermeer Panters","sPeriode3","pkGMPA","0"
"Zoetermeer Panters","sPeriode3","pkMPA","0"
"Zoetermeer Panters","sPeriode3","pkPSA","0"
"Zoetermeer Panters","sTimeout","pkMinorA","0"
"Zoetermeer Panters","sTimeout","pkMajorA","0"
"Zoetermeer Panters","sTimeout","pkMiscA","0"
"Zoetermeer Panters","sTimeout","pkGMPA","0"
"Zoetermeer Panters","sTimeout","pkMPA","0"
"Zoetermeer Panters","sTimeout","pkPSA","1"

So can store DataArray flat database then query database

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: Reading multiple data from a TMemo
« Reply #43 on: April 02, 2019, 04:24:46 pm »
Quote
(2) extracting the given penalties by their time per team over the whole game. I.e. how many 2 minutes penalties were given, how many 5 minutes penalties were give, etc.)
This answer ?

you count time, i not know time TPenaltyKind :)

Code: Pascal  [Select][+][-]
  1. procedure WritePenalTimeTeam(aValues: TPenaltyValues);
  2. var
  3.   fPenalty: TPenaltyKind;
  4. begin
  5.   for fPenalty in TPenaltyKind do
  6.     WriteLn(fPenalty, ' : ', aValues[fPenalty]);
  7. end;
  8.  
  9. procedure HavePenalTimeTeam(pp: TPenaltyParser; aTeam: TTeamStr; var aValues: TPenaltyValues);
  10. var
  11.   fTeam   : TTeamStr;
  12.   fPeriod : TPeriodStr;
  13.   fPenalty: TPenaltyKind;
  14.   fPenaltyValue : integer;
  15.   FlatString: String;
  16. begin
  17.   fTeam := aTeam;
  18.  
  19.   for fPenalty in TPenaltyKind do aValues[fPenalty] := 0;
  20.  
  21.   for fPeriod in TPeriodStr do
  22.   begin
  23.     for fPenalty in TPenaltyKind do
  24.     begin
  25.       fPenaltyValue := pp.DataArray[fTeam][fperiod][fpenalty];
  26.       if fPenaltyValue > 0 then
  27.       begin
  28.         inc(aValues[fPenalty], fPenaltyValue);
  29.       end;
  30.     end
  31.   end;
  32. end;
  33.  
  34. procedure Parse(aFilename: String);
  35. var
  36.   pp : TPenaltyParser;
  37.   aTeam: TTeamStr;
  38.   aValues: TPenaltyValues;
  39. begin
  40.   pp := TPenaltyParser.Create(aFilename);
  41.  
  42.   WriteLn(GetName(pp, sTeama), ' : ', 'given penalties by their time per team over the whole game');
  43.   HavePenalTimeTeam(pp, sTeamA, aValues);
  44.   WritePenalTimeTeam(aValues);
  45.   WriteLn;
  46.   WriteLn(GetName(pp, sTeamB), ' : ', 'given penalties by their time per team over the whole game');
  47.   HavePenalTimeTeam(pp, sTeamB, aValues);
  48.   WritePenalTimeTeam(aValues);
  49.  
  50.   pp.Free;
  51. end;
  52.  
  53. begin
  54.   Parse('52677.txt');
  55. end.
  56.  

is show:
Code: [Select]
Microz Eaters Limburg : given penalties by their time per team over the whole game
pkMinorA : 3
pkMajorA : 0
pkMiscA : 3
pkGMPA : 0
pkMPA : 0
pkPSA : 0

Zoetermeer Panters : given penalties by their time per team over the whole game
pkMinorA : 3
pkMajorA : 0
pkMiscA : 0
pkGMPA : 0
pkMPA : 0
pkPSA : 1

query dataarray not smart. double work many time  :-\

I not understand q1 complete. My english bad.  :-[  you try ?

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: Reading multiple data from a TMemo
« Reply #44 on: April 02, 2019, 05:23:38 pm »
for "1) extracting penalties per period per team by minutes given (2,5,10,20,25 & a penalty shot (=no minutes but to count then I set it to 50))." i think maybe work:

Code: Pascal  [Select][+][-]
  1. function GetName(pp: TPenaltyParser; aTeam: TTeamStr): String;
  2. begin
  3.   case aTeam of
  4.     sTeamA: Exit(pp.TeamA);
  5.     sTeamB: Exit(pp.TeamB);
  6.   end;
  7. end;
  8.  
  9. procedure WritePenalPeriodTimeTeam(pp: TPenaltyParser; aPenalty: TPenaltyKind);
  10. var
  11.   fTeam   : TTeamStr;
  12.   fPeriod : TPeriodStr;
  13.   fPenalty: TPenaltyKind;
  14.   fPenaltyValue: integer = 0;
  15. begin
  16.   WriteLn('Period', #9, 'Team', #9, 'Penalty', '  (', aPenalty, ')');
  17.  
  18.   for fPeriod in TPeriodStr do
  19.   begin
  20.     for fTeam in TTeamStr do
  21.     begin
  22.       fPenaltyValue := pp.DataArray[fTeam][fperiod][fpenalty];
  23.       WriteLn(fPeriod, #9, GetName(pp, fTeam), #9, fPenaltyValue);
  24.     end
  25.   end;  
  26. end;
  27.  
  28. procedure Parse(aFilename: String);
  29. var
  30.   pp : TPenaltyParser;
  31.   aTeam: TTeamStr;
  32.   aValues: TPenaltyValues;
  33.   aKind: TPenaltyKind;
  34. begin
  35.   pp := TPenaltyParser.Create(aFilename);
  36.  
  37.   WriteLn;
  38.   for aKind in TPenaltyKind do
  39.   begin
  40.     WriteLn;
  41.     WritePenalPeriodTimeTeam(pp, aKind);
  42.     WriteLn;
  43.   end;
  44.  
  45.   pp.Free;
  46. end;
  47.  
  48. begin
  49.   Parse('52677.txt');
  50. end.
  51.  

is write:
Code: [Select]
Period Team Penalty  (pkMinorA)
sPeriode1 Microz Eaters Limburg 1
sPeriode1 Zoetermeer Panters 0
sPeriode2 Microz Eaters Limburg 0
sPeriode2 Zoetermeer Panters 3
sPeriode3 Microz Eaters Limburg 2
sPeriode3 Zoetermeer Panters 0
sTimeout Microz Eaters Limburg 0
sTimeout Zoetermeer Panters 0


Period Team Penalty  (pkMajorA)
sPeriode1 Microz Eaters Limburg 1
sPeriode1 Zoetermeer Panters 0
sPeriode2 Microz Eaters Limburg 0
sPeriode2 Zoetermeer Panters 3
sPeriode3 Microz Eaters Limburg 2
sPeriode3 Zoetermeer Panters 0
sTimeout Microz Eaters Limburg 0
sTimeout Zoetermeer Panters 0


Period Team Penalty  (pkMiscA)
sPeriode1 Microz Eaters Limburg 1
sPeriode1 Zoetermeer Panters 0
sPeriode2 Microz Eaters Limburg 0
sPeriode2 Zoetermeer Panters 3
sPeriode3 Microz Eaters Limburg 2
sPeriode3 Zoetermeer Panters 0
sTimeout Microz Eaters Limburg 0
sTimeout Zoetermeer Panters 0


Period Team Penalty  (pkGMPA)
sPeriode1 Microz Eaters Limburg 1
sPeriode1 Zoetermeer Panters 0
sPeriode2 Microz Eaters Limburg 0
sPeriode2 Zoetermeer Panters 3
sPeriode3 Microz Eaters Limburg 2
sPeriode3 Zoetermeer Panters 0
sTimeout Microz Eaters Limburg 0
sTimeout Zoetermeer Panters 0


Period Team Penalty  (pkMPA)
sPeriode1 Microz Eaters Limburg 1
sPeriode1 Zoetermeer Panters 0
sPeriode2 Microz Eaters Limburg 0
sPeriode2 Zoetermeer Panters 3
sPeriode3 Microz Eaters Limburg 2
sPeriode3 Zoetermeer Panters 0
sTimeout Microz Eaters Limburg 0
sTimeout Zoetermeer Panters 0


Period Team Penalty  (pkPSA)
sPeriode1 Microz Eaters Limburg 1
sPeriode1 Zoetermeer Panters 0
sPeriode2 Microz Eaters Limburg 0
sPeriode2 Zoetermeer Panters 3
sPeriode3 Microz Eaters Limburg 2
sPeriode3 Zoetermeer Panters 0
sTimeout Microz Eaters Limburg 0
sTimeout Zoetermeer Panters 0

But maybe i wrong ?

You see can many double work  ;D

 

TinyPortal © 2005-2018