ComponentOne True DataControl 8.0
Find Method (XArrayDB)

Syntax

XArrayDB.Find (row, column, value, [order], [comparison], [type])

Method applies to XArrayDB object.

Arguments

row is a long integer specifying the starting row of the search.

column is a long integer specifying the column to be searched.

value is a variant specifying the value to search for.

order is an XORDER constant that specifies the direction of the search. If omitted, XORDER_ASCEND is assumed.

comparison is an XCOMP constant that specifies the kind of comparison to be performed. If omitted, XCOMP_EQ is assumed.

type is an XTYPE constant that specifies the data type used to coerce column values during comparison. If omitted, XTYPE_DEFAULT is assumed, which means that the data type of the value argument is used.

Return Value

A long integer corresponding to the index of the next row that contains a matching value. If no match is found, the value returned is one less than the lower bound for rows specified in the previous call to the ReDim method.

Description

The Find method searches for a specified value within a column of an XArrayDB object, starting at a particular row. If a match is found, this method returns the corresponding row index; otherwise, the value returned is equal to:

LowerBound(1) - 1

Example

The following example demonstrates the use of the Find method on a single-column XArrayDB object containing long integers:

MyArray.ReDim 1, 4, 1, 1

MyArray(1, 1) = 198

MyArray(2, 1) = 150

MyArray(3, 1) = 200

MyArray(4, 1) = 250

 

' search for the value 200

Debug.Print MyArray.Find(1, 1, 200) ' prints 3

 

' search for a value less than 200

Debug.Print MyArray.Find(1, 1, 200, , XCOMP_LT) ' prints 1

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback