Still having problems to save and load text and para styles

General TRichView support forum. Please post your questions here
Post Reply
VT
Posts: 18
Joined: Mon Jul 31, 2006 1:39 pm

Still having problems to save and load text and para styles

Post by VT »

I'm still having problems to save and load text and paragraph styles to a IniFile.
I have tried this code to save:

ini := TiniFile.create(ExtractFilePath(ApplicationExeName) + 'Font.ini');
try
textstyle.savetoIni(ini, 'font', 'fontP');
finally
ini.free;
end;

And this code to load:

ini := TiniFile.create(ExtractFilePath(ApplicationExeName) + 'Font.ini');
try
textstyle[0].loadfromIni(ini, 'font', 'fontP', false, 101);
finally
ini.free;
end;

When it is loaded the whole style becomes weird.
Can someone help me on this problem, please ?
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You want to save and load a single text style?

The third parameter must contain '%s'. For example,
textstyle.savetoIni(ini, 'font', 'font%s');
The same for loadfromini.
VT
Posts: 18
Joined: Mon Jul 31, 2006 1:39 pm

Post by VT »

Thanks Sergey, it worked.
Post Reply