Link to home
Start Free TrialLog in
Avatar of lloydie-t
lloydie-t

asked on

Working with ini files.

I have a weird one. I am using an ini file to hold the details of an aplication settings. For some reason the application does not use the ini file in the its path, but creates and uses one in the windows folder. Can I avoid this.
Code----------------------------------------------------------
procedure TPortSetupMain.ProcessSettings;
begin
portINI := TINIFile.Create(ExtractFilePath('datacollex1.exe') + 'callcollex.ini');
    portINI.WriteInteger('ComPortSet', 'Speed', LongInt(BaudValues[Bauds.ItemIndex]) * 10);
    portINI.WriteInteger('ComPortSet', 'Parity', Paritys.ItemIndex);
    portINI.WriteString('ComPortSet', 'Databits', IntToStr(8-Databits.ItemIndex));
    portINI.WriteString('ComPortSet', 'Stopbits', IntToStr(Succ(Stopbits.ItemIndex)));
portINI.Free;
------------------------------------------------------------
This maybe something to do with Windows XP!
   
ASKER CERTIFIED SOLUTION
Avatar of esoftbg
esoftbg
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lloydie-t
lloydie-t

ASKER

Thanks,
        I already had that info, but I thought it meant that I should replace it with a file name.
I understand your thought mistake well. Everybody can be wrong sometimes, don't worry about....