LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuration file integer type

Hello,
 
  I have integer data type in my ini file.  I have selected integer data type in my program while reading that value. 
If that value is empty in the ini file then my function returns error.  I gave default value as 0. 
My function returns error and then don't read any other values after that.
How do I solve this problem without changing that empty field to 0?
 
thanks
trupti
0 Kudos
Message 1 of 2
(2,537 Views)
Hello trupti,
the default value is intended to be used when the key is NOT found in the ini file, not when its value is invalid.
Leaving an empty value is much like putting a wrong value like any other non-numeric string.
To solve your problem, you may create a modified version of the "Read Key (I 32).vi", where you filter out error 19 (Config type invalid) and return the default value when the key value is empty. If you choose to do so, be very careful not to modify the original vi and save it with a different name to another location, checking the option "Save a copy without updating callers" in the Save as... dialog.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 2
(2,525 Views)