Computed Property bad behavior

Check those 2 little demos:

Am I needing more coffee or there is something wrong going on?

Bugged behavior here on 2013.r4.1

Both behave the same here and neither shows Avast

Known issue with Window construction <>
Literally to create the instance on the Window the code is “roughly”

dim message1 as new Message()
message1.Message = “”

Instances with properties are initialized

In fact put a break point in the setter for MessageClass.Message.Set and you’ll see it gets called

Here they differ in behavior. One receives “Avast” and another is blank.

Hey. Now that I reopened Xojo both are blank.

No reason - that seems like a bug

Put a break point in the setters and in both samples you should see they are called with what looks like an empty stack

At least thats the case for me in 2014r2.1, 2014r2 and 2013r4.1 on OS X 10.8.5
Whats your set up ?

As I told you, it’s now behaving like you said. They’re both blank. The Avast “stopped” to show on one of them (against the expected behavior of being initialized).

So we must ignore initializations and set the values “by hand” as you said?

dim obj as new myObj()
obj.myval = “Avast”


Ok. I made one step by step and it started to behave as before. It comes with “Avast”. :stuck_out_tongue:

Maybe If I save it and reload, it works differently. Will play a bit more. :frowning:

[quote=116220:@Rick Araujo]So we must ignore initializations and set the values “by hand” as you said?
Instances of items on a Windows pretty much all have this characteristic.
It also means setting values in the constructor of subclasses won’t work etc.
This is a long standing behavior & Joe & I have discussed how to correct it - but nothing concrete I can say much more than that about. Trust me you’re not the only one who’d like to have this work “as expected”