Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi [erledigt] Unbekanntes Problem : E2008 Inkompatible Typen (https://www.delphipraxis.net/68170-%5Berledigt%5D-unbekanntes-problem-e2008-inkompatible-typen.html)

xZise 25. Apr 2006 17:37


[erledigt] Unbekanntes Problem : E2008 Inkompatible Typen
 
Ich habe folgende Procedure
Delphi-Quellcode:
procedure TFIni.MIDelSectionClick(Sender: TObject);
var i : Integer;
begin
  if LBSections.ItemIndex > 0 then
    if MessageDlg('Wollen sie wirklich die Section ' + LBSections.Items[LBSections.ItemIndex] + ' löschen?', mtConfirmation, [mbYes] + [mbNo], 0) = 6 then begin
      for i := LBSections.ItemIndex to High(LBSections.Items) - 1 do begin // Zeile 347
        Section[i] := Section[i + 1];
        LBSections.Items[i] := LBSections.Items[i + 1];
      end;
      LBSections.Items.delete(High(LBSections.Items)); // Zeile 351
    end;
end;
nun sagt er zu mir:

Zitat:

[Fehler] UIni.pas(347): E2008 Inkompatible Typen
[Fehler] UIni.pas(351): E2008 Inkompatible Typen
Und LBSections ist eine ListBox

Dax 25. Apr 2006 17:42

Re: Unbekanntes Problem : E2008 Inkompatible Typen
 
Nimm statt High(LBSections.Items) lieber LBSections.Items.Count. :)

xZise 25. Apr 2006 17:44

Re: Unbekanntes Problem : E2008 Inkompatible Typen
 
Ah ja ^^ Hät ich auch so drauf kommen können ;) Danke!

- erledigt -

Thorben77 25. Apr 2006 17:48

Re: Unbekanntes Problem : E2008 Inkompatible Typen
 
Zitat:

Zitat von Dax
Nimm statt High(LBSections.Items) lieber LBSections.Items.Count. :)

Und noch besser LBSections.Items.Count - 1, die Indizes fangen ja bei 0 an.


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:26 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz