SftBox/OCX 4.5

SftBoxItems.Select Method

Softel vdm, Inc.

Searches items using text and selects the item found.

Syntax       

VB.NET

FoundIndex = object.Select(ByVal Text As String, ByVal StartIndex As Integer, ByVal ColNum As Short, ByVal Wrap As Boolean, ByVal IgnoreCase As Boolean, ByVal Exact As Boolean)  As Integer

VB

FoundIndex = object.Select(ByVal Text As String, ByVal StartIndex As Long, ByVal ColNum As Integer, ByVal Wrap As Boolean, ByVal IgnoreCase As Boolean, ByVal Exact As Boolean)  As Long

C#.NET

int FoundIndex = object.Select(string Text, int StartIndex, short ColNum, bool Wrap, bool IgnoreCase, bool Exact);

VC++

long FoundIndex = object->Select(_bstr_t Text, long StartIndex, short ColNum, VARIANT_BOOL Wrap, VARIANT_BOOL IgnoreCase, VARIANT_BOOL Exact);

C

HRESULT object->raw_Select(BSTR Text, long StartIndex, short ColNum, VARIANT_BOOL Wrap, VARIANT_BOOL IgnoreCase, VARIANT_BOOL Exact, long* FoundIndex);

Delphi

FoundIndex := object.Select(Text : WideString; StartIndex : Integer; ColNum : Smallint; Wrap : WordBool; IgnoreCase : WordBool; Exact : WordBool)   : Integer;

object

A SftBoxItems object.

Text

The text to be searched.

StartIndex

The zero-based index of the item where the search is to begin (including the item at StartIndex).

ColNum

The zero-based index of the column to be searched. Only cells in this column will be searched and only one column can be searched at a time.

Wrap

Specify True to allow the search to wrap around and begin at the first item when the end of the list is reached. If False is specified, the search will end at the end of the list.

IgnoreCase

Specify True to compare Text and the cell text of each item ignoring differences between uppercase and lowercase characters. Specify False for a case sensitive comparison.

Exact

If True is specified, Text must match the cell text completely (still depending on IgnoreCase). If False is specified, the Select method will select the first item whose cell text starts with Text.

FoundIndex

Returns the zero-based index of the item found and selected. -1 is returned if no match was found.

Comments

The Select method searches items using text and selects the item found.

The string described by Text is compared to the Cell.Text property of all items involved in the search. The search starts at the item described by StartIndex and is restricted to the column specified by ColNum. If an item with a matching Cell.Text property is found, it is selected and its zero-based index is returned, otherwise -1 is returned.

Only one column can be searched at a time. The comparison of Text and the Cell.Text property may be case sensitive based on the IgnoreCase argument.

If the Cell.Text starts with the string in Text, it is considered a match if Exact is False. If Exact is True, the Cell.Text property must be completely equal to Text.


Feedback / comments / error reports for this topic
© 2008 - Softel vdm, Inc. - www.softelvdm.com