Spread 8.0 Documentation
SSSearchRow Function
Support Options
DLL Reference > DLL Functions > SSSearchRow Function

Glossary Item Box

SSSearchRow Function


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Searches a row for a specified value or string.

Syntax

C

SS_COORD SSSearchRow(HWND hWnd, SS_COORD lRow, SS_COORD lColStart, SS_COORD lColEnd, LPCTSTR lpszText, WORD wSearchFlags);

C++

SS_COORD SearchRow(SS_COORD lRow, SS_COORD lColStart, SS_COORD lColEnd, LPCTSTR lpszText, WORD wSearchFlags);

Parameters

The following parameters are available:

Parameter Description
hWnd Window handle of the fpSpread control
lRow Row in which to search
lColStart Column at which to start searching (column is not included in search)
lColEnd Column at which to end searching
Set to SS_ALLCOLS to search all columns.
lpszText Pointer to text for which to search
Search for an empty string to find empty cells.
wSearchFlags Specify how the search is performed
Use the (|) OR operator and combine the following values as indicated:
Constant
Description
SS_SEARCHFLAGS_NONE
Searches for exact match to complete text in cell, but ignores cases
SS_SEARCHFLAGS_GREATEROREQUAL
Search for text or a value greater than or equal to the specified text or value
SS_SEARCHFLAGS_PARTIALMATCH
Search for text that matches or partially matches the specified text
SS_SEARCHFLAGS_VALUE
Searches for text as if the text provided is equivalent to calling the SSGetValue function
SS_SEARCHFLAGS_CASESENSITIVE
Search for text that exactly matches the text and case specified
Use one of the following values:
SS_SEARCHFLAGS_SORTEDASCENDING
Use for searching in columns that are sorted in ascending order. The method works more rapidly on a sorted column if you specify this setting.
SS_SEARCHFLAGS_SORTEDDESCENDING
Use for searching in columns that are sorted in descending order. The method works more rapidly on a sorted column if you specify this setting.

Remarks

This function is applied to the current sheet setting unless you first call the SSSetSheet function to specify the sheet for which you are calling this function.

Call the SSSearchRow function to search for specified text or values in a row. To search for each occurrence of the text or value, call the SSSearchRow function and set the lColStart parameter to –1. Then, call the SSSearchRow function again, specifying the returned column from the previous call as the value of the lColStart parameter for each succeeding call. When the function returns –1, you have returned all occurrences of the text or value.

Note: Row headers are not searched.

Setting SS_SEARCHFLAGS_VALUE for the wSearchFlags parameter lets you search for a value using the unformatted value of the data. For example, suppose the sheet had a currency value such as "i 4,451,493.00" in a cell. If you wanted to search for the unformatted value, 4451493.00, you could specify that unformatted value as the search string, and set the wSearchFlags parameter to SS_SEARCHFLAGS_VALUE to find the currency value without specifying any formatting. This might be useful if you are unsure of the currency symbol or some other formatting character that will be used in the data.

Call the SSSearchCol function to search for text or a value in a particular column.

Return Value

Number of column containing the search text. Returns –1 if search text is not found.

See Also

Searching for Data

SSGetValue, SSSearchCol, SSSetSheet functions

ActiveX Correspondence

SearchRow method

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.