11-08-2012 03:42 PM
I am using the following code in an attempt to set AppFont, SystemFont, and DialogFont in an executable's .ini file all to Segoe UI 15. I was disappointed to discover that the configuration file VIs don't seem to write the key correctly. When I use this code, I get the following in the .ini file:
AppFont = ""Segoe UI" 15"
SystemFont = ""Segoe UI" 15"
DialogFont = ""Segoe UI" 15"
What I really need is:
AppFont = "Segoe UI" 15
SystemFont = ""Segoe UI" 15
DialogFont = "Segoe UI" 15
In other words, the configuration file VIs add an extra set of quotation marks. With this extra set of quotation marks, the executable ignored these settings. The "write raw string?" input didn't seem to affect this behavior.
Does anyone know of a way to get the configuration file VIs to write this key/value pair correctly, or do I need to write extra code to either remove the quotations or do the whole thing myself? It seems like the configuration file parsing/editing VIs that NI provides should be able to parse and edit NI-provided configuration files...
11-08-2012 06:38 PM
There is no way to do this with the current config file API. That "write raw string" input only pertains to escaping certain characters. We also have an internal API for writing data specifically to the LabVIEW.ini file, but it has the same problem with extra quotes. For now, you'll need to either refrain from using the config file VIs, or add some post-processing code to go in and remove the extra quotes.
11-09-2012 10:57 AM
Thanks, Darren. I did end up adding some post-processing code to remove the quotes. Here it is if anyone wants it: