Solved

INI Files With ListBox1

Posted on 1998-11-30
2
210 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

15 Experts available now in Live!

Get 1:1 Help Now