Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

Annoying Change in Behaviour WD19 => WD20 (1 reply)

$
0
0
G'day All,
I realise that I am a little slow off the mark in converting to V20 as I did not want to be held up by differences in behaviour in the new version. Well, I have found one that might seem obscure but has caused me a little grief so I thought I would share what I have found.

I use a lot of classes. I make the members PRIVATE and access them via properties.
I also have members that are dynamic object definitions that can be assigned to "point" to existing instantiated objects. I declare them as say:
m_pclMyPtr is ctMyclass dynamic

To create the property I use the "Right click" on the member in the project explorer. This generates the "Getter" and "Setter" procedures.
(N.B. In V19, as I created them they would appear in the explorer property list. That does not happen in V20. They do not show)

This process creates the Procedure definitions like:

PROCEDURE p_pclMyPtr(clValue ) : ctMyClass // Getter

PROCEDURE p_pclMyPtr(clValue is ctMyClass) // Setter

Now, up to V19 I could assign a Null value to the member via the class property Setter, defined above. e.g.
clMyObject.p_pclMyPtr = Null

In V20, if I assign a value of Null to the property as defined above then this does not happen. What happens is that the member is assigned an "Empty" class container. I say empty because the class has not even been instantiated i.e. the Constructor has NOT run. Seems like the class is being treated like a structure.

However, if I remove the type specification in the Procedure declaration for the Setter procedure then the member DOES get assigned to Null. i.e. the Setter definition becomes

PROCEDURE p_pclMyPtr(clValue) // Setter

This behaviour has been introduced in V20. Currently I am reviewing my code to confirm I have found all instances where this affects me.

I have no idea why PC Soft have done this. Null is a valid value for a dynamic object as far as I know. The difficult thing is that the member ends up an invalid value. Not Good!

So far, this is the only substantive issue I have had in upgrading to V20. Pretty good really.
I am guessing that this behaviour will also carry over to V21.
Cheers,
Steve H

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>