Is it possible to distinguish zero value and value absence for integer property?

As far as I understand, integer property is compiled to an int field. But when I set "allow empty" to true in its editor, there are two different valid cases in editor: 0 and <no value>. In both cases property value is 0. Is there any way to differ these cases? Or the only solution is to wrap property in the separate concept?
1 comment

I would love to follow-up on this question: we want to check whether an integer property is set. To do that, we use the SModel-API:

SProperty property = property/Concept : intProperty/;
this/.getProperty(property).isEmpty;

This works fine, when the property was never set. However, if the property was once set and was afterwards deleted, I will get the original value (even if the editor does state <no intProperty>). I also checked the code generation and actually the code generation gets also the original value returned. Is this a bug?

Thanks,

Christian

0

Please sign in to leave a comment.