Skip to main content
Participant
April 23, 2014
Question

How does operator 'less than' work with Rectangle objects?

  • April 23, 2014
  • 1 reply
  • 353 views

Just found in legacy code the following:

private var firstRect:Rectangle;

private var secondRect:Rectangle;

if (firstRect < secondRect)

{

// do something

}

How does operator 'less than' work with Rectangle objects?

Doc says that object is converted to number if it is not a String.

Rectangle is not a String, though has conversion to String.

Please help.

This topic has been closed for replies.

1 reply

Amy Blankenship
Legend
April 23, 2014

Probably the best thing to do is to try different rectangle values with different operators until you understand it.

Participant
April 23, 2014

Is there are a chance to know for sure how it works instead of bruteforce rectangles?

Amy Blankenship
Legend
April 23, 2014

IME the best way to know for sure is to experiment. The docs are only one person's best understanding of how things worked on the day, which is seldom 100% accurate. I find that even with code I wrote I can't accurately say 100% of what it does until I've worked with it for a while. Keep in mind that the docs are usually written when the code is written, so  never expect more than a rough idea from the docs.