Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Inis - Nur bestimmte Sections auflisten (https://www.delphipraxis.net/14397-inis-nur-bestimmte-sections-auflisten.html)

citybreaker 8. Jan 2004 14:53


Inis - Nur bestimmte Sections auflisten
 
Hallo,

nehmen wir mal an ich hätte folgende Sections in einder
Ini Datei stehen.

[Optionen]
irgendeine=option
[Section 01]
aaa=aa
[SectionDie2.]
aa=aaa

Wie kann man nun alle Sections bis auf die Option
Section auflisten?

--- Edit ---

Zur Zeit mache ich es folgendermaßen.
Delphi-Quellcode:
Ini.ReadSections(ListBox.Items);
Hier bei werden alerdings alle Sections aufgelistet.

sakura 8. Jan 2004 15:03

Re: Inis - Nur bestimmte Sections auflisten
 
Mache es wie folgend:

Delphi-Quellcode:
ListBox.Items.BeginUpdate;
try
  Ini.ReadSections(ListBox.Items);
  I := ListBox.Items.IndexOf('Optionen');
  if I >= 0 then
    ListBox.Items.Delete(I);
finally
  ListBox.Items.EndUpdate;
end;
...:cat:...

citybreaker 8. Jan 2004 15:14

Re: Inis - Nur bestimmte Sections auflisten
 
Danke, klappt wunderbar.

sakura 8. Jan 2004 15:19

Re: Inis - Nur bestimmte Sections auflisten
 
P.S.: Solltest Du ggf. vorhandene Items aus der Listbox löschen wollen, tue dieses innerhalb des try...finally Blockes ;-)

...:cat:...


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:28 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