Solved

INI Files With ListBox1

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
control image tags in a string ? 12 141
PHP preg_replace code convert to Delphi 14 66
firemonkey keyboard covers the controls 1 37
Twebbrowser add css to the header 3 27
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

809 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