Finds the next row in a resultSet in which data meets a specified condition.
row=result.find(SearchCondition,[startRow [,endRow]]);
SearchString is a DataWindow expression
Returns the number of the first row that meets the search criteria within the search range. Returns 0 if no rows are found and one of these negative numbers if an error occurs:
-1 General error
-5 Bad argument
0 Not found
If any argument's value is null, it returns NULL
Examples:
Search in resultSet object column "itemcode" for the value "RM"
// This return the first position
row=result.find("itemcode='RM'");
// search with brackets or/and
row=result.find("itemcode='RM' or itemcode='RM_S') and onhand>0,1,result.rowcount()");
The search is case sensitive. When you compare text to a value in a column, the case must match.
When the Find expression includes quotes
If the text you want to find includes quotes, you must treat the nested quote as doubly nested, because the DataWindow parses the string twice before the Find method uses it. Therefore, you cannot simply alternate double and single quotes, as you can in most strings.
For example, to find the name O’Connor, the Find expression can be:
"O~~~’Connor" (3 tildes and single quote) or "O~~~~~"Connor" (5 tildes and double quote)
but not:
"O’Connor" or "O~"OConnor"