Autor Beitrag
bayou
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 88


D6 PE
BeitragVerfasst: So 04.09.05 22:19 
Hi Leute,

Ich arbeite gerade ein Programm durch und versuche etwas hin und her und habe eine Fehlermeldung Incompatible Types.

Hier der Code

ausblenden Delphi-Quelltext
1:
2:
3:
  private
    { Private declarations }
    MemoLyrics : Array [0..7of TRichEdit;



ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
function TFormMusicData.getActiveRichEdit():TRichEdit;
var
    i : integer;
begin
  for i := 0 to 7 do
  if (PageControlTexts.ActivePageIndex = [i]) then
    result := MemoLyrics[i]
  else
    result := RichEditDummy;
end;


Ich wäre euch Dankbar wenn jemand mir erklären könnte wo der Fehler liegt oder ob das überhaupt nicht geht.
Bin halt noch Anfänger.

Danke
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: So 04.09.05 22:26 
Wieso schreibst du [i] und nicht einfach i?
Und ich denke nicht, dass der Code das macht, was du willst...

Vielleicht funktioniert deine Idee damit:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
Index := PageControlTexts.ActivePageIndex;
if Index >= 0 then
 Result := MemoLyrics[Index] else
 Result := RichEditDummy;
bayou Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 88


D6 PE
BeitragVerfasst: So 04.09.05 22:42 
super, vielen Dank. Ich werde es gleich mal Testen.