10-30-2018 07:33 PM
LabVIEW 8.6 saves keys in a format like this:
[thisSection]
thisKey=26.6
thatKey=12,5,76
theOtherKey=c:\workspaces\specialFile.txt
LabVIEW 2018 saves keys in a format like this:
[thisSection18]
thisKey18="26.6"
thatKey18="12,5,76"
theOtherKey18="c:\workspaces\specialFile.txt"
Notice the addition of quotation marks on the key values.
Why was the change made?
It's causing a mess, since the client's code calls a code library which depends on the sections and keys in the original format.
Is there a backward comparability setting?
I currently am using a workaround which is to
1. close the key file
2. rename the key file (1)
3. use string VIs to remove blank lines and quotation marks from the renamed file (1)
4. write text to the original file
5. continue processing the key file
Check out the LabVIEW 2018 code below, please.
Solved! Go to Solution.
10-31-2018 01:19 AM
@Jandy wrote:
LabVIEW 8.6 saves keys in a format like this:
[thisSection]
thisKey=26.6
thatKey=12,5,76
theOtherKey=c:\workspaces\specialFile.txt
LabVIEW 2018 saves keys in a format like this:
[thisSection18]
thisKey18="26.6"
thatKey18="12,5,76"
theOtherKey18="c:\workspaces\specialFile.txt"
Notice the addition of quotation marks on the key values.
Why was the change made?
It's causing a mess, since the client's code calls a code library which depends on the sections and keys in the original format.
Is there a backward comparability setting?
I currently am using a workaround which is to
1. close the key file
2. rename the key file (1)
3. use string VIs to remove blank lines and quotation marks from the renamed file (1)
4. write text to the original file
5. continue processing the key file
Check out the LabVIEW 2018 code below, please.
Quotes around the value in an ini file is acceptable in some implementations; when a portion of a value is in quotes, it means "parse this part literally". I guess LabVIEW puts strings in quotes so it doesn't get fooled into parsing a character inside the quotes as a special character. Of course this doesn't really help you. This is an inherent problem with ini files because there isn't really a standard. I guess xml files would be a little more reliable (although I've heard similar complaints about LV xml implementations, also).
Unfortunately, I don't know how to do better than what you are describing. 😞
10-31-2018 02:05 AM - edited 10-31-2018 02:12 AM
Hi,
to expand on billko's message:
I guess LabVIEW puts strings in quotes
Yes, it does so.
Now the question is: do you save those keys as strings?
Atleast this one needs to be saved as string:
thatKey=12,5,76
So you might rethink your tool to generate those INI files…
Is there a backward comparability setting?
Quotes around strings is compatible with usual Windows INI files. The problem is that other (not compatible) EXE expecting strings without quotes…
I currently am using a workaround which is to
Some other workaround: did you examine the WriteKey function (in its "string" variant)? Maybe you need to create a copy (!) of that function without the AddQuotes subVI inside…
10-31-2018 09:18 AM
Another work around, is you could post process the file after it is done being written. If all you want to do is remove all " characters then you could open the file with the Read From Text File, perform a search and replace setting it to replace all " with an empty string, then resave the file.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-31-2018 10:41 AM
I do know that the configuration file library had a bit of an overhaul with LabVIEW 2009 (the version right after 8.6). I could not tell you if this was involved in that update or not though.