Herror ::obj_to_integer (
    Hobject Objects,
    const HTuple &Index,
    const HTuple &Number,
    HTuple *SurrogateTuple
)

Convert an iconic object into an ``integer number.''

::obj_to_integer stores Number, starting at index Index, of the database keys of the input object Objects as integer numbers in the output parameter SurrogateTuple. This facilitates a direct access to an arbitrary element of Objects. In conjunction with ::count_obj (returns the number of objects in Objects) the elements of Objects can be processed successively. The objects are not duplicated by ::obj_to_integer and thus must not be cleared by ::clear_obj.


Attention

The objects' data is not duplicated.


Parameters

Objects (input_object)
object-array -> Hobject: HObjectArray
Objects for which the surrogates are to be returned.

Index (input_control)
integer -> HTuple.long
Starting index of the surrogates to be returned.
Default value: 1
Typical range of values: 1 <= Index

Number (input_control)
integer -> HTuple.long
Number of surrogates to be returned.
Default value: 1
Restriction: (Number + Index) <= number(Objects)

SurrogateTuple (output_control)
integer-array -> HTuple.long *
Tuple containing the surrogates.


Example
/* Access the i-th element: */
long i,Surrogate;
obj_to_integer(Objects,i,1,&Surrogat);

Complexity

Runtime complexity: O(|Objects| + Number)


Result

::obj_to_integer returns H_MSG_TRUE if all parameters are correct. If the input is empty the behavior can be set via ::set_system('no_object_result',<Result>). If necessary, an exception is raised.


Possible Predecessors

::test_obj_def


Alternatives

::copy_obj, ::select_obj, ::copy_image, ::gen_image_proto


See also

::integer_to_obj, ::count_obj


Module

Basic operators



Copyright © 1996-2002 MVTec Software GmbH