How to load an .ini file in response to changing the With-IniFiles-Filled-ComboBox?
Posted on 2005-04-09
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;
// 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!
THANKS AND KEEP ON ROCKING I'D SAY!!