| AHELP for CIAO 4.5 ChIPS v1 | get_object_count |
Context: utilities |
Synopsis
Get the number of instances of the specified object type
Syntax
get_object_count(object_type) get_object_count(id, object_type)
Description
- id - an optional ChipsId structure containing values to modify the currency state for the command.
- object_type - Specifies the particular object whose count is desired; it is the object type from "ahelp chipsopt", e.g. chips_curve or chips_image.
The get_object_count command retrieves the object count of a number of current chips objects. Users can use the Chips_id object if the current window is not the window which contains the frames whose viewing mode is to be affected. Currency is not affected.
Example
chips> clear()
chips> add_frame(.1, .1, .5, .5)
chips> add_curve([1,2,4,6], [2,4.4,2.8,3], "line.color=green
symbol.color=yellow")
chips> add_frame(.5, .5, .9, .9)
chips> add_curve([10,20,30,40,50,60,70,80],[23,25,27,25,22,19,18,21],
"line.color=coral")
chips> add_curve([.5,2,4,6], [1,4,4,2.5], "line.color=blue")
chips> print get_object_count(chips_axis)
2
chips> print get_object_count(chips_curve)
1
chips> current_curve("all")
chips> get_object_count(chips_curve)
2
chips> id = ChipsId()
chips> id.frame="frm1"
chips> print get_object_count(id, chips_curve)
1This example creates a window with two frames. In the first frame (frm1) the script inserts a curve; in the second frame (frm2) the script places two curves. Frame "frm2" is current. The number of axis objects, in that frame, is retrieved, and then the number of curve objects is retrieved. As there is only one current curve in "frm2", the value of "1" is returned. Both curves are then made current and the number of curve objects is requested. This time the command returns the value "2" as there are two current curves in that frame. A Chips id structure is instantiated and the frame member is filled in with "frm1". The "get_object_count" command is issued, using the id structure, and requesting the number of curves. The expected value of "1" is returned.
Bugs
See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.
See Also
- concepts
- setget
- frames
- add_frame, arrange_frames, blink_frames, current_frame, delete_frame, display_frame, get_frame, hide_frame, move_frame, next_frame, reposition_frame, set_frame, tile, view_placed_frame, view_single_frame
- utilities
- erase, set_current

![[ChIPS Logo]](../imgs/chips_logo_navbar.gif)