Next: Boolean;
The Next method continues search and returns True in case of finding the next value.
Sub Main;
Var
MB: IMetabase;
Rep: IPrxReport;
Tab: ITabSheet;
CellSearch: ITabCellSearch;
Result: ITabSearchResult;
s: String;
i: Integer;
Begin
MB:=MetabaseClass.Active;
Rep:=MB.ItemById("Reg_rep").Bind As IPrxReport;
Tab:=Rep.ActiveSheet.Table;
CellSearch:=Tab.CreateCellSearch;
CellSearch.Text:="123";
Result:=CellSearch.Execute;
If Result<>Null Then
i:=i+1;
s:=s+Result.Range.Address+" ";
Repeat
If Result.Next Then
i:=i+1;
s:=s+Result.Range.Address+" ";
Else
Break
End If;
Until False;
Else
s:="The value is not found"
End If;
End Sub Main;
After executing the example the "123" value is searched in cells. If the search result is positive, the "i" variable contains the number of found cells, the "s" variable contains addresses if the found cells separated with the space.
See also: