Board index » delphi » Delphi 1 : saving styles in .INI files

Delphi 1 : saving styles in .INI files

Can you please help with this problem:

I need to save the settings associated with various fonts and
pens/brushes - but the INI file can only handle int/str/boolean types.
How do I save styles in the INI file OR what "work around" could I use??

Thanks in advance
Derek.

dho...@csir.co.za

 

Re:Delphi 1 : saving styles in .INI files


Quote
derek <dho...@csir.co.za> wrote:
>Can you please help with this problem:
>I need to save the settings associated with various fonts and
>pens/brushes - but the INI file can only handle int/str/boolean types.
>How do I save styles in the INI file OR what "work around" could I use??

Try sometihing like this:
function writeStyle(Section, Key, : string, Sender: TObject);
var ini : Tinifile;
begin
   ini := Tinifile.create('c:\test.ini');
   ini.writebool(Section, Key + 'Bold' , fsBold in Sender.font.Style);
   ini.writebool(Section, Key + 'Italic' , fsItalic in
Sender.font.Style);
   ini.writebool(Section, Key + 'Underline' , fsUnderline in
Sender.font.Style);
   ini.writebool(Section, Key + 'StrikeOut' , fsStrikeOut in
Sender.font.Style);
   ini.free
end;

------------Accounting Components(TM)-----------
Martin Jacobsen            mar...@economica.com
            http://www.economica.com          
-Business Objects for Borland Delphi developers-

Other Threads