Property with default value being serialized

Posted by jquerijero on 03-Apr-2015 15:48

I'm struggling to figure out what setting (or setup like PROPATH and etc.) can cause PDS to emit/serialize properties with default values. Every time I open a window, control or usercontrol in the designer, un-overridden properties (mostly custom properties) are being emitted to the source code. I'm looking at the same program file opened by a co-worker in the designer and it has none of the extraneous properties inside the InitializeComponent.

Any ideas? 

All Replies

Posted by gabriel.lucaciu on 06-Apr-2015 04:16

Hi,

Gan you give a short example of extra property that was added ? So that we can make an idea of what is it about...

All the best,

Gabriel

Posted by Simon L. Prinsloo on 06-Apr-2015 04:38

Hi

Which version and service pack are you using, and is your colleague using the same version?

Posted by jquerijero on 06-Apr-2015 09:55

We are both on 11.4.0

Here is a sample (they appear bolded)

   THIS-OBJECT:locQuoteID:MessageLevel = 0.

   THIS-OBJECT:locQuoteID:MessageText = "".

Here is how those properties are defined

 DEFINE PUBLIC PROPERTY MessageLevel AS INTEGER NO-UNDO INIT 0

   GET.

   SET(INPUT newValue AS INTEGER):

...

   END SET.

 DEFINE PUBLIC PROPERTY MessageText AS CHARACTER NO-UNDO INIT ""

   GET.

   SET(INPUT newValue AS CHARACTER):

...

   END SET.

Posted by Laura Stern on 06-Apr-2015 10:19

When use use the INIT keyword, that is setting an explicit value.  That is not a "default" value.  The default value is what the AVM sets a variable to without any input from the ABL code.

Nevertheless, you're correct - it is unnecessary for InitializeComponent to set the value as the class itself will do it.  But I'm guessing (only guessing) that this is what's causing it.  Try without the INIT and see what happens.

Posted by jquerijero on 07-Apr-2015 14:45

[quote user="Laura Stern"]

When use use the INIT keyword, that is setting an explicit value.  That is not a "default" value.  The default value is what the AVM sets a variable to without any input from the ABL code.

Nevertheless, you're correct - it is unnecessary for InitializeComponent to set the value as the class itself will do it.  But I'm guessing (only guessing) that this is what's causing it.  Try without the INIT and see what happens.[/quote]

Removing INIT unfortunately did not help. It's just odd that on my co-worker's workspace, this doesn't happen (with or without INIT). So this might be some kind of a setting.

This thread is closed