LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

close config data.vi changes comment lines

When using the "close config data.vi" with write config file set to true, I get ="" appended to comment lines, like

; this is a comment line

changes to

; this is a comment line=""
Does LV6.1 not support comment lines or does it use a different character?
0 Kudos
Message 1 of 5
(2,551 Views)
I believe these config files follow the Microsoft standard, so you may want to search their site for comments in ini files. What is happening is that the program thinks the comment is a key that has no value (="").

Jeremy Braden
National Instruments
0 Kudos
Message 2 of 5
(2,551 Views)
I have searched both MS site and a general Google search - I can not find an OFFICAL document stating that a line begining with a ';' is a comment - it seem to be general a general practice, including *.ini files from microsoft. Several sites dealing with ini files do talk about the use of ';' as a comment delimiter (only if the 1st char. in the line) see http://www.ctyme.com/inityme.htm for an example.
Microsoft also includes code snippits such as


;
; PermissionDataSet INI encoding
;
; Sample INI File
;
;

; A semi-colon (;) at the beginning of a line signifies a
; comment to the end of the current line.

; AllowActiveX tells the sign tool to sign with full ActiveX
; permissions, in addition to any other permissions.




If a ';' as th
e 1st char in a line does not define a comment line how do you comment a .ini file ??
0 Kudos
Message 3 of 5
(2,551 Views)
This is a problem of the close config vi.

The vi gets all keys (keys are the values before 😃 and the values (behind
=). When the data is stored, the vi puts 'key'='value' in a string for each
line.

When a empty line is encountered, this happens. The key is ''. The value is
''. The output result is ="", because empty values, and values with spaces
in them are contained between quotes.

When '; comment' is encountered, the key is ';comment', the value is '', the
result is ;comment="".

You'll have to modify a very low level sub vi inside close config.vi to
resolve this. The problem has been there since lv supports .ini files.

Regards,

Wiebe.

"BillT" wrote in message
news:506500000008000000C6490000-1021771306000@exchange.ni.com...
> Whe
n using the "close config data.vi" with write config file set to
> true, I get ="" appended to comment lines, like
>
> ; this is a comment line
>
> changes to
>
> ; this is a comment line=""
> Does LV6.1 not support comment lines or does it use a different
> character?
Message 4 of 5
(2,551 Views)
Thanks!!
I went in to the "close config data.vi" -> "Config Data Write to File.vi" -> "Config Data to String.vi"

The "Config Data to String.vi" is where I corrected the problem. Where they looked to see if the line has "[" & "]" I added a check for the first char = ";" and OR'ed it in.

The code is attached
0 Kudos
Message 5 of 5
(2,551 Views)