![]() |
for schleife will nicht
ich hab ein problem mit einer for schleife. hab schon alles versucht. mein ziel: für alle items in der combobox soll eine zeile geschrieben werden.
Delphi-Quellcode:
warum läuft die schleife nicht bis zum letzten item, sondern schreib nur itemindex 0 hin.for i:=0 to combobox.ControlCount do Ini.WriteString('Menüs','Menü 1',combobox.items[i]); |
Re: for schleife will nicht
Zitat:
Siehe OLH: ControlCount Richtig:
Delphi-Quellcode:
for i:=0 to ComboBox.Items.Count -1 do
begin ... end; |
Re: for schleife will nicht
Deshalb:
Delphi-Quellcode:
Schreib mal
for i:=0 to combobox.ControlCount do
Delphi-Quellcode:
Greetz
for i:=0 to combobox.Items.Count-1 do
alcaeus [edit]Das war 100%ig gleichzeitig[/edit] |
Re: for schleife will nicht
Zitat:
Delphi-Quellcode:
:wink:
combobox.Items.Count -1
|
Re: for schleife will nicht
In der Schleife lässt du ja auch für jedes Item das gleiche hinschreiben, nämlich unter der Sektion "Menü" in den Eintrag "Menü1".
Außerdem musst du Combobox.Items.Count nehmen ;-) Probiers mal so:
Delphi-Quellcode:
for i:=0 to combobox.Items.Count do
Ini.WriteString('Menüs','Menü '+inttostr(i),combobox.items[i]); |
Re: for schleife will nicht
ja stimmt, aber jetzt schreib er nur die ersten beiden.
ist schon gut, weiß woran es liegt. danke |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:10 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz