search: search the index of an item in the array. returns -1 if it is not found.
objarray search ?-sorted? <obj> <value>
(if array is sorted it performs a faster binary search).
e.g.
set obj [objarray new_from_to intarray 2 5] -> 2 3 4 5 objarray search -sorted $obj 4 -> 2