objectnumber
objectnumber
ID

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

Parameters

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.).

Description

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
    X=1
    selectobjects objectinfo("class") contains "TextEditor"
    loop
        objectnumber X
        stoploopif (not info("found")
        objectNames=
        sandwich("",objectNames,cr())+objectinfo("name")
        X=X+1
    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

- activeobjectaction -- allows a procedure to communicate with the object on the current form that is currently being edited (if any).
- changeobject -- modifies the properties of one object in a form.
- changeobjects -- modifies the properties of one or more objects in a form.
- cloneform -- copies all of the objects in a form (optionally, with modifications) into the active form.
- cloneobjects -- duplicates objects in a form (with modifications).
- closeactiveobject -- closes any object whose text is currently being edited.
- datamode -- switches a form from graphics mode into data mode.
- deleteobject -- deletes the specified object from the current form.
- deleteselectedobjects -- deletes selected objects from a form.
- draggraybox -- facilitates dragging something around in a form window.
- dragtext -- starts drag-and-drop of text.
- formcleanview -- cleans up extraneous NSView objects in the current form.
- formxy -- programmatically scrolls a form to a new position.
- graphicsmode -- switches a form into graphics mode.
- info("activeobject") -- returns the name of the currently active text editor or word processor object (if any).
- info("activeobjectid") -- returns the object ID of the currently active text editor or text list object, if any.
- info("activesuperobject") -- returns the name of the currently active text editor or word processor object, if any.
- info("click") -- returns the location of the last mouse click in screen relative coordinates.
- info("clickedobjectid") -- returns the object ID of the clicked object.
- info("focusobject") -- returns the name of the currently active text editor or word processor object, if any.
- info("focusobjectid") -- returns the object ID of the currently active text editor or text list object, if any.
- info("scrollpoint") -- returns the distance the current form is scrolled horizontally and vertically.
- magicformwindow -- designates an open window as the temporary active window for the purposes of info( functions and graphic statements.
- magicwindow -- designates an open window as the temporary active window for the purposes of info( functions and graphic statements.
- magnification -- changes the magnification of a form.
- Modifiable Object Properties -- describes the properties of graphic objects that can be modified by a program (dimensions, color, font, title, etc.).
- newformobject -- creates a new graphic object in a form.
- object -- selects an object (based on the object name).
- objectaction -- allows a procedure to communicate with an object on the current form.
- objectid -- selects one graphic object in the current form based on an ID number.
- objectinfo( -- returns information about a graphic object: its location, size, color, font, etc.
- objectinfoarray( -- builds a text array of form object properties
- openasyncprogresswindow -- opens a floating progress window for asynchronous operations (urltask(, timers).
- progressalert -- displays a progress alert if an operation is going to take a long time.
- progressbar -- updates a progress bar on the current form.
- selectallobjects -- selects all the graphic objects in the current form.
- selectnoobjects -- unselects all the graphic objects in the current form.
- selectobjects -- uses a formula to select one or more objects in the current form.
- startgraphicschange -- adds undo support to a procedure.
- Text Display Programming -- programming a Text Display Object.
- Text Editor Programming -- programming a Text Editor Object.
- textlisttableoptions -- sets up text list table options
- Web Browser Programming -- programming a Web Browser Object (including JavaScript).
- xytoxy( -- converts a point or rectangle from one co-ordinate system to another.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0.