Help with an IF block

I can not imagine what is the problem with such obvious behaviour.
I have and instance of a class defined in the module (local): Polyline
This class has a property called Closed.
I’ve created a break point to check the value of this property and it is TRUE.
However if I press the button Step the program skips the IF block.
How is it possible?
Here you have an animation to understand better the problem.

An help will be appreciated.

I remember helping someone with an issue like this a long time ago, it was something like two instances conflicting, maybe one was a global, I can’t quite remember but its worth checking that you don’t have another Polyline somewhere that is in scope at that point.

It could be. I will look at it. Thanks!

Try putting the value into a local variable

[code]Dim debugClosed as boolean
debugClosed = PolyLine.closed

if debugClosed then
//etc[/code]

@Julian
Unfortunately it is not the reason.
As it was local object I changed its name: POLYLINE2D, so now it is impossible to coincide with another object.
And the behaviour is exactly the same.

@Jeff
This is a good idea.
I wrote this line before the IF :

Dim Closed As Boolean = Polyline2D.Closed

And curiously according to the variables panel
Closed = False
Polyline2D.Closed = True
I don’t understand.

It seams that the problem is the property called “Closed”. “Closed” i protected?
Perhaps, because I changed the property name to “Clossed” ans everything works as it should.

This type of silent errors not detected are very, very annoying.

Really depends on what this class is a subclass of
I cant tell that from the gif

[quote=450898:@Norman Palardy]Really depends on what this class is a subclass of
I cant tell that from the gif[/quote]
Thanks Norman for paying attention to this case.
In fact there was a misinformation in what I said: “Closed” was a method of the Class, not a property.
I don’t know if this is relevant or not, but I think it is, and most of that behaviour was due to this fact.
Fortunately everything works now and I can go on with my task.

Really wont matter whether it was a Property or Method
Having to rename to a misspelled name works around the issue but I was trying to focus on understanding why this issue arose in the first place
Hence why I was curious about super classes etc

[quote=450944:@Norman Palardy]Really wont matter whether it was a Property or Method
Having to rename to a misspelled name works around the issue but I was trying to focus on understanding why this issue arose in the first place
Hence why I was curious about super classes etc[/quote]
Hi Norman.
I’m sorry I couldn’t answer you before.
This class is defined as Public in a method and has no Super
I hope it serves to you now.

[quote=451131:@Ramon SASTRE]Hi Norman.
I’m sorry I couldn’t answer you before.
This class is defined as Public in a method and has no Super
I hope it serves to you now.[/quote]
Creating a new project, adding an empty class, and checking the Closed property won’t compile - so something in your project is named Closed on a global scope. You may wish to look for and fix that.

Thanks Tim for your help.
In fact I changed the name of the property and everything worked, so I forgot about looking for the real reason.
But the thing is I am not complaining about this problem, my concern is about the fact that Xojo said nothing at all, this property(method) was a boolean and Xojo returned False without saying anything about any possible duplicate.
May be this is the normal way for Xojo, but when you are used to so many error detections (which I love), it was very difficult to isolate this problem.

Yeah, it’s not a huge issue since you’re up and running again. I’m just the curious type who likes to know why something operates the way it does - so I’d dig into the cause :slight_smile:

There’s some thing not right about whats been posted
tyDXF_Polyline in the second image has no super and no property named closed which doesnt match up with the very first image
So closed isnt inherited based on this second image

[quote=451182:@Norman Palardy]There’s some thing not right about whats been posted
tyDXF_Polyline in the second image has no super and no property named closed which doesnt match up with the very first image
So closed isnt inherited based on this second image[/quote]
Yes, you are right.
The second image belongs to the solved problem. I changed “Closed” for “Tancada”, but the rest is exactly the same as before.