The Language of Rectangles and Rectangle Objects


#1

I post this for the benefit of those, like me, who have found the language and syntax surrounding rectangles to be confusing. I realized recently just how confusing it was to me when I tried to use the rectanglecenter( function. After studying the class video and demo, here is what I learned about the basics of rectangles.

A rectangle, in Panorama parlance, is a binary value that defines the coordinates of a rectangle object or other object. The rectanglecenter( function returns such a binary value. Obviously, to be useful, that rectangle binary needs to be assigned to an object (using changeobject or newformobject statements). So a rectangle object is what gets drawn on the form; the rectangle is a binary value defining the coordinates of that object. Just to add to the potential for confusion caused by the terminology, all objects have a rectangle property. Just think about it, lines have rectangle!

The inputs to the rectanglecenter( function are the rectangles from two objects, which the Panorama help page refers to as the larger rectangle and the smaller rectangle. Of course, they do not need to be larger and smaller than each other nor to be rectangle objects. To get the rectangle for object A, use objectinfo(“rectangle”,”A”).

To center object 2 in object 1, the code would be

changeobject 2,“rectangle”,rectanglecenter(objectinfo(“rectangle”,1), objectinfo(“rectangle”,2))

This assigns the newly calculated value for the centered rectangle value to object 2.

Voilá. Object 2 is centered in Object 1. [You may insert the quoted object names for object IDs 1 and 2 if the objects have been named.]

My confusion came from not distinguishing the rectangle, a binary value, from a rectangle object. If I could go back and change the terminology, I would use something like rectanglevalue to refer to the binary value of a rectangle. Probably too late for that.

Hopefully, I got this all correct.


#2

This is potentially confusing, to be sure, but it’s been that way since Panorama 4.0 at least (and maybe 3.0). In addition, many other programming languages have similar confusion around this exact topic. The problem is that there are two types of different types of things that are both rectangles - 1) a geometrical rectangle, which is simply 4 coordinate values, and 2) a rectangle object.

I think you are correct that it is too late to change the terminology, and in fact I suspect that it would have been impossible to make terminology like rectanglevalue stick even if it had been started that way. We all learned in school that 4 coordinates is a rectangle – there’s no way that ProVUE could ever manage to give that concept a new name.


#3

In reviewing the class on this topic, you did make the distinction clear between rectangle values and rectangle objects; at the time, I did not expect to need to make that kind of object manipulation, so I did not really learn it. So I take responsibility for the confusion. Having finally figured it out, I just wanted to pass along my “discovery” in case other were having a similar problem.


#4

I appreciate your post , I have never clearly made that distinction. It now makes so much more sense.