unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DBCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
Label10: TLabel;
Edit11: TEdit;
ComboBox1: TComboBox;
Button3: TButton;
DBRadioGroup1: TDBRadioGroup;
DBRadioGroup2: TDBRadioGroup;
DBRadioGroup3: TDBRadioGroup;
DBRadioGroup4: TDBRadioGroup;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
wupb1, wupb2, wupb3, wupb4, wupb1d, wupb2d, wupb3d, wupb4d, wupgesd, wupges: integer;
begin
//Einlesen der Variablen
wupb1 := StrToInt(Edit2.Text);
wupb2 := StrToInt(Edit3.Text);
wupb3 := StrToInt(Edit4.Text);
wupb4 := StrToInt(Edit5.Text);
wupb1d := StrToInt (Edit7.Text);
wupb2d := StrToInt (Edit8.Text);
wupb3d := StrToInt (Edit9.Text);
wupb4d := StrToInt (Edit10.Text);
//Abzüge pro Bahn
//Bahn1
case DBRadioGroup1.ItemIndex
of
0 : wupb1 := wupb1 - 1;
1 : wupb1 := wupb1 - 2;
2 : wupb1 := wupb1 - 5;
end;
//Bahn2
case DBRadioGroup2.ItemIndex
of
0 : wupb2 := wupb2 - 1;
1 : wupb2 := wupb2 - 2;
2 : wupb2 := wupb2 - 5;
end;
//Bahn3
case DBRadioGroup3.ItemIndex
of
0 : wupb3 := wupb3 - 1;
1 : wupb3 := wupb3 - 2;
2 : wupb3 := wupb3 - 5;
end;
//Bahn4
case DBRadioGroup4.ItemIndex
of
0 : wupb4 := wupb4 - 1;
1 : wupb4 := wupb4 - 2;
2 : wupb4 := wupb4 - 5;
end;
//Drops pro Bahn incl. Zuzüge
wupb1 := (wupb1d * 2) + wupb1;
wupb2 := (wupb2d * 2) + wupb2;
wupb3 := (wupb3d * 2) + wupb3;
wupb4 := (wupb4d * 2) + wupb4;
//GesamtDrops
wupgesd := wupb1d + wupb2d + wupb3d + wupb4d;
//GesamtSchläge incl. Abzüge
wupges := wupb1 + wupb2 + wupb3 + wupb4;
//Ausgabe - Gesamt Drops
Edit11.Text := IntToStr(wupgesd);
//Ausgabe - Gesamt Schläge incl. Zu-/Abzüge
Edit6.Text := IntToStr(wupges);
end;
procedure TForm1.Button3Click(Sender: TObject);
var
name:
string[15];
f :textfile;
begin
//Name aus ComboBox einlesen
case combobox1.itemIndex
of
0 :
name := '
Felixxx';
1 :
name := '
Katja';
2 :
name := '
Lenni';
3 :
name := '
Markus';
4 :
name := '
Oli';
5 :
name := '
Peter';
6 :
name := '
Rase';
7 :
name := '
Togi';
8 :
name := '
Wasi';
end;
//In Datei schreiben
AssignFile(f,'
erg_wup.txt');
{$i-}
Append(f);
{$i+}
if IOResult <> 0
then halt;
Writeln(f,
name + '
,' + Edit2.Text + '
,' + Edit7.Text + '
,' + Edit3.Text + '
,' + Edit8.Text + '
,' + Edit4.Text + '
,' + Edit9.Text + '
,' + Edit5.Text + '
,' + Edit10.Text + '
,' + Edit6.Text + '
,' + Edit11.Text);
CloseFile(f)
end;
end.