Franz Franz - 11 months ago 157
Ini Question

Write INI files with comment lines using TiniFile class

Can I use the

TIniFile
class from Delphi in any way to write comments to my INI files ?

[VALUES]
; first number
a=5
; something else
b=25
...
...


In the examples (EXAMPLE) I found on the web there are sometimes nice comment lines added, but not shown how to create, read , write these lines ....

Answer Source

The TIniFile class is a loose wrapper around the Windows API functions the provide INI file services. That API does not support writing comments and so TIniFile cannot do so either.

If you want to emit files with comments, you will have to find a different INI file library, or roll your own.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download