[Lazarus] How is XMLConfig supposed to work?

Sven Barth pascaldragon at googlemail.com
Wed Nov 27 16:59:06 CET 2013

Am 27.11.2013 16:53, schrieb Frederic Da Vitoria:
> 2013/11/27 Sven Barth <pascaldragon at googlemail.com 
> <mailto:pascaldragon at googlemail.com>>
>     Am 27.11.2013 16:30, schrieb Frederic Da Vitoria:
>>     2013/11/27 leledumbo <leledumbo_cool at yahoo.co.id
>>     <mailto:leledumbo_cool at yahoo.co.id>>
>>         >From http://wiki.lazarus.freepascal.org/xmlconf, looks like
>>         simply setting
>>         FileName will do.
>>     Yes, that part works. I dislike the way it works (Implicit saving
>>     does not seem very Pascal-ish to me), but it does save a file. My
>>     issues are rather with the xml, but I'll rather answer to waldo
>>     kitty here
>     TIniFile and TMemIniFile do an implicit save as well... (the
>     former during each .Write* the latter during destruction)
>     Regards,
>     Sven
> Yes. But my Pascal reference is Assign - Reset/Rewrite, Close. I still 
> have difficulties appending "File" after Assign and Close :-P
But XmlConfig is AFAIK a spiritual "successor" to TIniFile which is why 
I brought it up.
> Now that I think of it, I never tried to do a new AssignFile after the 
> Reset/Rewrite step, but I would be much surprised if it flushed and 
> closed the first file handle.
It won't flush or close the file, but if you haven't copied the Textfile 
or File variable somewhere else then you'll lose the reference to the 
file. It will be closed when the application is terminated, but 
everything that was not flushed until the Assign will stay in the buffer 
and won't be in the file... Of course this problem is a bit theoretical 
and is not really related to your problem :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20131127/7261cc79/attachment-0003.html>

More information about the Lazarus mailing list