• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
April 26, 2024, 05:01:05 am

News:

SMF - Just Installed!


SaveConfig to INI

Started by henry64, February 23, 2010, 07:09:04 am

Previous topic - Next topic

henry64

Hi

How can I save the com config to an INI file rather that the registry?

Roman Novgorodov

Hello

You can use standard TStringList class.

Something like following:

procedure SaveComConfig();
var slIni : TStringList;
begin
  slIni := TStringList.Create;
  slIni.Values['baudrate'] := IntToStr(nrComm1.BaudRate);
  slIni.Values['parity'] := IntToStr(Integer(nrComm1.Parity));
  slIni.SaveToFile('c:\my.ini');
  slIni.Free;
end;


Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.