Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How to load an .ini file in response to changing the With-IniFiles-Filled-ComboBox?

Posted on 2005-04-09
Medium Priority
Last Modified: 2010-04-16
Hi Folks!

I'm running into some probs regarding .ini files. I have a combobox filled with different .ini files and I want to load the one which is shown. Selecting a different .ini file in the combobox should then let my app load the selected .ini file. Now I've tried the loading and that goes well > My app responds the way it should. However implementing the combobox thingie causes the IDE to crash and in response requires me to Ctrl-Alt-Del the H*ll outta there.
This is my code:

// This works to my satisfaction >
vg2appinifile1.IniFileName := 'C:\Woordzoeker\Bestand1.ini';

// This clearly doesn't
vg2appinifile1.IniFileName := 'C:\Woordzoeker' + '\'+ cbIniBestanden.Items.Names[0];
// This should now be equal to 'C:\Woordzoeker\Bestand1.ini given that the first item in the combobox is Bestand1.ini right?
// Delphi's IDE answers wrong each time I tried to get this thing working. Closing the app crashes the IDE > it fails to write to the  // c:\woordzoeker directory and it shows the inifiles.pas unit

// Btw this code is under construction :) but since I already stumbled on loading one ini file from the combobox I felt discouraged to continue and try to have the combobox decide which ini file to load. It would be perfect if you could show me how to do that and comment it as well and my guess would be that when I comprehend what I'm doing wrong in the above code, I will then understand how to have the combobox decide which ini file to load more easily.

If you need more info please let me know!

Regards and respect,


Ps as always > providing the working copy&paste stuff grants you points!

**** In general > a big thank you to all-o-ya who make this resource to what it is: The Best Place to visit for solving Delphi (and loads of other!) problems! ******

Kretschzmar, Madshi, Geobul, BlackTigerX, rlibby, Slick812, Ferroccio68, mnasman, Workshop_Alex, Dragonslayer, esoftbg, EddieShipman, Shane Holmes, Carzkiss > thanks a lot guys and I CERTAINLY have forgotten some people who helped me out as well but those mentioned I can almost certainly recall assisting me! In fact there are so many of knowledgeable people here that they're too many to mention and it's easy to forget someone,  but alas > I hope I made myself clear when it comes to expressing my appreciation > Programming wouldnt be so much fun without all of you :) If your name is not in the list then bear with me you were not deliberately forgotten!

Question by:PeterdeB
  • 3

Author Comment

ID: 13743785
Btw in the second code fragment > The line that reads vg2appinifile1.load should be added. It is present in both cases just for your information.


LVL 17

Accepted Solution

mokule earned 200 total points
ID: 13744290
What You've got in cbIniBestanden?
I would rather say that You should have
vg2appinifile1.IniFileName := 'C:\Woordzoeker' + '\'+ cbIniBestanden.Items[0];
or better
vg2appinifile1.IniFileName := 'C:\Woordzoeker' + '\'+ cbIniBestanden.Items[cbIniBestanden.ItemIndex];

Author Comment

ID: 13744391
Hi Mokule tnx for responding!

Oh okay > then I'll try that !



Author Comment

ID: 13744404
Problem solved tnx my friend!


Peter :)

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

564 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