Solved

INI Files With ListBox1

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 84
When I am typing into a TEdit last word repeats 7 117
Delphi Form ownership 4 73
Performance of SQL statement 37 101
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

867 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

21 Experts available now in Live!

Get 1:1 Help Now