Jump to content
Sign in to follow this  
Henri_M

Use type definition default values instead of Labview default values

Recommended Posts

I have been using JKI Design Palette and the EasyXML toolkit for a few weeks and I must say both are very useful tools, the former making my application look more professional and the latter saving a lot of time compared to coding a custom XML parsing.

However, the "Best Attempt" Parsing feature of EasyXML turned out to behave differently from what I expected. Using the Easy Read XML File or Easy Parse XML functions, when passing an array of (type def) clusters as the "LabView Data (type)" argument, I expected that the missing data from the XML file (i.e. an element missing from a cluster) would be replaced by the default value defined in the type definition. It turns out not to be the case. The missing data is replaced by the LabView default value. This is problematic because this default value (0 for an int) is among the "legit" values I intend to use, as opposed to (for example) -1, that would allow me to immediately detect missing values.

What surprises me most is that this behavior seems to have been acknowledged as non-optimal in this topic from 2010:

 

Is there something I am missing here ? I tried using strict type definition, to no avail. The typedef enum I have inside my cluster also defaults to the first value, not to the default value I defined.

 

Thanks, 

Henri

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.