Bei mir tritt immer der Fehler "inkompatible typen; 'Integer' und 'Extended'" und ich kann ihn nich beheben. Wäre toll, wenn mir jemand helfen könnte.
ps: Es ist noch nicht fertig. Möchte, dass wenn man auf den button klickt, sich ein neues formular öffnet und alle daten, die eingegeben und ausgerechnet wurden, darin stehen.
Quelltext:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) ComboBox1: TComboBox; Label1: TLabel; ComboBox2: TComboBox; Label2: TLabel; Label3: TLabel; RadioButton1: TRadioButton; RadioButton2: TRadioButton; CheckBox1: TCheckBox; Edit1: TEdit; Label4: TLabel; Label5: TLabel; Edit2: TEdit; CheckBox2: TCheckBox; Edit3: TEdit; Edit4: TEdit; Label6: TLabel; Label7: TLabel; Label8: TLabel; Button1: TButton; Button2: TButton; Button3: TButton; procedure Button3Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button1Click(Sender: TObject); private public end;
var Form1: TForm1;
implementation
uses Unit2;
{$R *.DFM}
procedure TForm1.Button3Click(Sender: TObject); begin close end;
procedure TForm1.Button2Click(Sender: TObject); begin edit1.clear ; edit2.clear ; edit3.clear ; edit4.clear ; end;
procedure TForm1.Button1Click(Sender: TObject); var tarif, i, km, datum1, datum2, uhrzeit1, uhrzeit2, preis : integer; begin datum1:=StrToInt(edit1.text); datum2:=StrToInt(edit3.text); uhrzeit1:=StrToInt(edit2.text); uhrzeit2:=StrToInt(edit4.text); case combobox1.itemindex of 0: tarif:=0.2 ; 1: tarif:=0.5 ; 2: tarif:=0.25 ; end; case combobox2.itemindex of 0: km:=25 ; 1: km:=50 ; 2: km:=75 ; 3: km:=100 ; 4: km:=200 ; 5: km:=500 ; 6: km:=1000 ; end; i:=1 ; repeat preis:=i*tarif ; i:=i+1 ; until i=km ; showmessage('Ihre Reisedaten: Hinfahrt: am ' + IntToStr(datum1) + ' um ' + IntToStr(uhrzeit1) + ' Rückreise: am ' + IntToStr(datum2) + ' um ' + IntToStr(uhrzeit2)); end;
end. |
Moderiert von
raziel: Delphi-Tags hinzugefügt