Solved

INI Files With ListBox1

Posted on 1998-11-30
2
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

696 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