The objectnumber statement identifies one graphic object from a set of selected graphic objects in the current form.


This statement has one parameter:

id – identifies the graphic object within the set of selected graphic objects. The first graphic object is 1, the second is 2, etc. If you specify a number that is larger than the number of selected object info(“found”) will be false. (Note: Graphic objects are numbered in back to front order.).


This statement locates the nth selected object so that you can retrieve information about the object. The first selected object is 1, the second is 2, etc. After this statement you can use the objectinfo( function to get information about the object. This statement allows you to create a loop to accumulate information about multiple graphic objects within the form.

The example procedure below builds a list of the names of all text editor objects in the current form.

local objectNames,X
selectobjects objectinfo("class") contains "TextEditor"
    objectnumber X
    stoploopif (not info("found")
while forever

Note: Panorama now has a new function, objectinfoarray(, that can build the same list in a single line!

objectinfoarray({objectinfo("name")},{objectinfo("class") contains "TextEditor"})

This statement can also be used to identify the object closest to the front or the back in the selected set. To identify the object closest to the back, use 1.

selectobjects objectinfo("font")="Helvetica"
objectnumber 1

To identify the object closest to the front, use objectinfo(“count”).

selectobjects objectinfo("font")="Helvetica"
objectnumber objectinfo("count")

See Also


10.0No ChangeCarried over from Panorama 6.0.