Autor Beitrag
bonanza
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: So 11.12.05 12:00 
Hi,
ich bekomme folgenden Fehler:

[Error] Unit3.pas(35): Incompatible types: 'TEdit' and 'Integer'

Bei diese Quellcode:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
begin
Feld := StrToInt(Feld.Text);
Fragen[Feld] := Frageneu;
close;
end;


Also Fragen ist ein Array
und Feld, Frageneu ein Editfeld

Wo ist der Fehler ?

danke schonmal im voraus

bonanza
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 11.12.05 12:14 
user profile iconbonanza hat folgendes geschrieben:
Hi,
ich bekomme folgenden Fehler:

[Error] Unit3.pas(35): Incompatible types: 'TEdit' and 'Integer'

Naja, Da steht bei dir irgendwo eine TEdit-Variable, wo eigentlich eine Integer-Variable stehen sollte. Ich kommentiere mal deinen Code
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
begin
//Feld ist ein TEdit. Warum weist du ihm eine Zahl zu?
Feld := StrToInt(Feld.Text);
// Fragen ist ein Array, Feld ein TEdit. Was bitte schon soll dann Fragen[Feld] sein?
Fragen[Feld] := Frageneu;
close;
end;

Abhilfe: Da wo das "Integer-Feld" steht, eine neue Integer-Variable einsetzen. Allerdings blicke ich nicht ganz, was du vorhast, daher kann ich dazu nicht allzuviel sagen ;-)

_________________
We are, we were and will not be.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: So 11.12.05 13:21 
Versuch mal statt Frageneu Frageneu.text oder strtoint(fragene.text)
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: So 11.12.05 14:17 
Ich würde dir den Crashkurs von Christian empfehlen!

Crashkurs Delphi

greetz