Solved

INI Files With ListBox1

Posted on 1998-11-30
2
213 Views
Last Modified: 2010-04-04
Hi..
I'm in trouple..
when my program starts I like to read from ini file into listbox.
(All text that are under ? key in ini file into the listbox)
Can you have a complete code ( thanks..... )
0
Comment
Question by:mummi
2 Comments
 

Expert Comment

by:foxvision
ID: 1348674
Can u please give a very short example of your INI file ?
0
 
LVL 4

Accepted Solution

by:
erajoj earned 50 total points
ID: 1348675
uses ..., IniFiles;

var
  ini: TIniFile;
  section: TStringList;
  ...
  ini := TIniFile.Create( 'MyFile.ini' );
  section := TStringList.Create;
  ini.ReadSectionValues( 'MySection', section );
  ListBox1.Items.Clear;

  { All Section Text }
  ListBox1.Items.AddStrings( section );

  { Just Names }
  for iIndex := 0 to section.Count - 1 do
    ListBox1.Items.Add( section.Names[ iIndex ] );

  { Just Values }
  for iIndex := 0 to section.Count - 1 do
    ListBox1.Items.Add( section.Values[ section.Names[ iIndex ] ] );

  section.Free;
  ini.Free;

/// John
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now