Locate search

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Fastex
Posts: 15
Joined: Wed 20 Oct 2010 08:52

Locate search

Post by Fastex » Fri 21 Jan 2011 19:43

Hello. I need to create search. I use UniTable, and made search by method "Locate".

Code: Select all

TLocateOptions Opts;
Opts.Clear();
Opts TabTypesOfBoards->Locate("NameOfAC", sEdit2->Text, Opts))
        {
                sEdit2->Color=clRed;
        }
else
        {
                sEdit2->Color=clWhite;
        }
It works. But i need to know 2 functions: Find Next and Find previous. How can I make it ? What functions can do it ?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 24 Jan 2011 09:40

Hello,

To implement such behavior you should use the LocateEx method like

Move to the next record:

Code: Select all

  TLocateExOptions Opts;
  Opts.Clear();
  Opts TabTypesOfBoards->LocateEx("NameOfAC", sEdit2->Text, Opts));
Move to the previous record:

Code: Select all

 
  TLocateExOptions Opts;
  Opts.Clear();
  Opts TabTypesOfBoards->LocateEx("NameOfAC", sEdit2->Text, Opts));
For more information please see the TLocateExOption Enumeration topic in the UniDAC help.

Post Reply