[Lazarus] How is XMLConfig supposed to work?

Frederic Da Vitoria davitofrg at gmail.com
Wed Nov 27 22:04:12 CET 2013

2013/11/27 Sven Barth <pascaldragon at googlemail.com>

>  Am 27.11.2013 16:53, schrieb Frederic Da Vitoria:
>  2013/11/27 Sven Barth <pascaldragon at googlemail.com>
>>  Am 27.11.2013 16:30, schrieb Frederic Da Vitoria:
>>  2013/11/27 leledumbo <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.

Ah, OK.

>   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 :)

Absolutely :-)

Frederic Da Vitoria

Membre de l'April - « promouvoir et défendre le logiciel libre » -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20131127/8d97ea3e/attachment-0003.html>

More information about the Lazarus mailing list