ObjectCount

Category: Objects / Search
Since engine version: 4.6.5.0 CP

Description

Searched objects by certain criteria and returns the number of objects found. If iWdt and iHgt are both -1, the closest object is found. If iWdt and iHgt are both 0, only the point iX/iY will be checked. If iX, iY, iWdt and iHgt are all 0, the whole map will be searched (even in local calls). All other criteria have to be fulfilled if they are not 0.

Syntax

int ObjectCount (id idDef, int iX, int iY, int iWdt, int iHgt, int dwOCF, string szAction, object pActionTarget, any pContainer, int iOwner);

Parameters

idDef:
[opt] Object type
iX:
[opt] Left boundary coordinate of the target rectangle (x coordinate).
iY:
[opt] Top boundary coordinate of the target rectangle (y coordinate).
iWdt:
[opt] Width of search rectangle
iHgt:
[opt] Height of search rectangle
dwOCF:
[opt] Object attributes. Only objects with all specfied attributes will be returned in the search. 0 finds all objects.
szAction:
[opt] Activity of the object
pActionTarget:
[opt] Activity target of the object. Also see SetAction, GetActionTarget
pContainer:
[opt] Container object. If specified, only this container will be searched. Also possible: NoContainer (object is not contained) or AnyContainer (object is contained in any container).
iOwner:
[opt] Owner value for which to search.
See also: AnyContainer, FindObject, FindObjectOwner, NoContainer, ObjectCount2
jwk, August 2002