Guten Tag,
ich habe heute angefangen mit delphi ein wenig zu experementieren.
Habe früher mal Java 2 Jahr programmiert und C++.
Jetzt wollte ich mein erstes Programm in Delphi schreiben und komme nicht weiter.
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:
| unit main;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) Label1: TLabel; Ergebnis1: TEdit; Ergebnis2: TEdit; Label2: TLabel; Label3: TLabel; Label4: TLabel; Button1: TButton; procedure Button1Click(Sender: TObject); private public end;
var Form1: TForm1; Datei: TextFile;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); var zahl1,zahl2,punkte1,punkte2: integer; begin punkte1:=0; punkte2:=0; zahl1 := StrToInt(Ergebnis1.Text); zahl2 := StrToInt(Ergebnis2.Text); if zahl1 > zahl2 then begin punkte1 := punkte1+3; end else if zahl2>zahl1 then punkte2 := punkte2+3
else punkte1 := punkte1+1; punkte2 := punkte2+1; end;
AssignFile(Datei,'neu.txt'); Rewrite(Datei); if IOResult = 0 then begin writeln(Datei,'Hallo!'); writeln(Datei,'Die Datei ist jetzt neu.'); writeln(Datei,'Sie kann nun verändert werden.'); CloseFile(Datei); end;
end. |
Fehlermeldung:
Zitat: |
[Hint] main.pas(52): Value assigned to 'punkte2' never used
[Hint] main.pas(43): Value assigned to 'punkte1' never used
[Hint] main.pas(4 : Value assigned to 'punkte2' never used
[Hint] main.pas(51): Value assigned to 'punkte1' never used
[Hint] main.pas(3 : Value assigned to 'punkte2' never used
[Hint] main.pas(37): Value assigned to 'punkte1' never used
[Error] main.pas(57): Declaration expected but identifier 'AssignFile' found
[Error] main.pas(65): '.' expected but ';' found
[Fatal Error] Fifa10.dpr(5): Could not compile used unit 'main.pas' |
Ich weis nicht wo der Fehler liegt. Muss ich bei uses noch was integrieren ?
Danke schonmal im voraus
Moderiert von
Narses: Quote- durch Delphi-Tags ersetzt.