10-02-2009 09:43 AM
By default value I mean the value that you normally get by default when you create a variable of that type. For a simple number variable that value is 0, but for variables that are part of an instance of a type things get more complicated. For type instances, if a subproperty in the instance has the same value as the corresponding subproperty in the type definition then that property will not get written out (the whole property doesn't get written, not just the value). This is because it is effectively redundant information that we will get from the type definition anyway. Basically we only need to store the differences from the type definition when writing out type instances. This explanation is a bit of an oversimplification though as there are many special cases which would result in the instance properties being written out such as use of the unstructured flag on the type definition, or setting flags in general on the type instances.
Another special case that you should be aware of is if you use RWOption_ValuesOnly then TestStand will write out all of the values no matter whether or not they are the same as the default. I do not recommend using this option though as it isn't type safe (doesn't ensure that the types when written are the same types when read) and doesn't ensure that the properties saved in the file actually exist when you read it (it just ignores the ones that don't exist). The normal behavior without this flag is that the properties saved in the file get recreated in the destination object (when read in), but using this flag disables that functionality.
Anyway, I think using only RWOption_EraseExistingObject or RWOption_EraseAll like you are doing now is probably the best way to go.
Probably way more information than you were expecting :), but hope it helps,
-Doug
10-02-2009 01:17 PM