04-05-2018 06:28 AM
Hello,
I'm trying to edit automatically (with a LB/CVI program) some items values of an ini file which is often edited by users but the empty lines are deleted and they must stay (for visibility), is it possible with Labwindows/CVI ?
04-05-2018 06:46 AM
With C (and thus with CVI) almost everything can be programmed
04-05-2018 07:38 AM
Additionally, I can confirm that CVI iniFile instrument does honor and maintain empty lines when it saves .INI files.
04-05-2018 09:24 AM
Maybe I forgot something, can you take a look to my code which replace some item's values of the ini file ? There is already items and values I just want to change them but all the empty lines of the file are deleted. (but the change of values work well)
04-05-2018 09:59 AM
You only have to add Ini_ReadFromFile at the beginning of the process; this will permit you also to issue Ini_Putxx calls only for modified parameters and not for all of them.
04-06-2018 01:10 AM
Sorry I forgot to put it in the file but there is a Ini_ReadFromFile just after the "file=Ini_New(0)".
04-06-2018 02:13 AM
Ok you're right: the IniFile instrument honors empty lines between sections but not those within a section (i.e. empty lines separating different items in a section).
From what I see, you have a couple alternatives at your hand:
04-06-2018 03:01 AM
The only alternative I can do is to modify Inifile code I will check this.
Thank you for your help.