Daylight v4.9
Release Date: 1 February 2008


dt_count - return the number of objects of a type in a compound object

Generic Prototype

dt_count(dt_Handle, dt_Integer) => dt_Integer

C Prototype

#include "dt_smiles.h"

dt_Integer dt_count(dt_Handle object, dt_Integer type)

FORTRAN Prototype

include ''

logical dt_f_count(object, type)

integer*4 object
integer*4 type


Counts the number of objects of the specified type within or associated with a given object 'object'. In general, dt_count(object, type) will be the length of a stream that would be produced by dt_stream(object, type).

With a sequence or stream, dt_count(3) returns the number of items in the enumeration. Not that this is the total number of items of a given type that would be returned via dt_next(3). For example, given a stream of molecules, dt_count(stream, TYP_ATOM) returns 0, as opposed to the total number of atoms contained in all molecules in the stream.

The special type TYP_ANY can be used to obtain the total count of items, regardless of type.

Return Value

Returns the count. For inappropriate combinations of objects and types, this property is defined as -1.

Related Topics