Board index » delphi » Search Routines/Engines

Search Routines/Engines

I am looking for several pascal/asm based search routines/engines.  These search
engines can be for both sorted and unsorted lists.

Basically I am trying to get a wide variety of search routines.  To be used in
several applications I am developing.  These applications use all kinds of data
and thus I can't get real specific as to what I need.  Obviously my applications
need to search a database and I need the source code so I can modify it to suit
my needs.

thanks.

--
   The true measure of a person's intelligence is not
to test him to see what he knows, but to ask him what
he does not know. . .
   The fool knows everything, the wise man knows nothing.
-"I made this"

Quote
>In virtually every field that I deal with, I know absolutely nothing compared
>with the vastness of information that is out there.  I just hope to absorb as
>much of that information as I can.

- George Wenzel <gwen...@gpu.srv.ualberta.ca>
 

Re:Search Routines/Engines


Quote
highl...@fastlane.net wrote:

: I am looking for several pascal/asm based search routines/engines.  These search
: engines can be for both sorted and unsorted lists.

: Basically I am trying to get a wide variety of search routines.  To be used in
: several applications I am developing.  These applications use all kinds of data
: and thus I can't get real specific as to what I need.  Obviously my applications
: need to search a database and I need the source code so I can modify it to suit
: my needs.

: thanks.

I am including my source to my search routine.  If it helps great.  It's
obviously imbedded with my database stuff, so I hope you can decifer and
use as you need.

Procedure SearchPerson;

(* Reads a record in. *)

Var
   Person : MailEntry;
   Count, CurrentPos, LineCount : integer;
   Entry, Param2 : string;
   Decision : char;
   DecisionMade : boolean;

Begin (* SearchPerson *)
     DecisionMade := False;
     YellowOnBlue;
     ClrScr;
     FullScreenBorder;
     GotoXY(36,6); Write('Search');
     DrawBox(9,70,7,19);
     GotoXY(22,9); Write('Enter the string to search for... ');
     TextBackground(Black);
     GotoXY(22,11); Write('                                        ');
     TextColor(LightGray);
     GotoXY(22,11);
     readln(Entry);
     CursorOff;
     ConvertToUpcase(Entry,Param2);
     Linecount := 0;
     Reset(MailFile);
     If IOResult = 0 then
        While Not EOF(MailFile) do
        Begin
             Read(MailFile, Person);
             If Found(Param2, Person.LastName)  or
                Found(Param2, Person.FirstName) or
                Found(Param2, Person.Address)   or
                Found(Param2, Person.City)      or
                Found(Param2, Person.State)     or
                Found(Param2, Person.Zip)       or
                Found(Param2, Person.DateSent)  or
                Found(Param2, Person.ItemSent)  then
             Begin
                  If Person.LastName <> '' then
                     With Person do
                     Begin
                          WhiteOnBlack;
                          GotoXY(11,13); Write('                                                        ');
                          GotoXY(11,14); Write('                                                        ');
                          GotoXY(11,15); Write('                                                        ');
                          GotoXY(11,16); Write('                                                        ');
                          GotoXY(11,13); Write(LastName,', ',FirstName);
                          GotoXY(11,14); Writeln(Address);
                          GotoXY(11,15); Writeln(City,', ',State,' ',Zip);
                          GotoXY(11,16); Writeln('"',ItemSent,'" was sent on ',DateSent);
                          YellowOnBlue;
                          GotoXY(25,18); Write('Press <Enter> to continue...');
                          readln;
                     end;
             end;
        end; (* while not *)
        TextColor(White);
        TextBackground(Blue);
        GotoXY(25,18); Write('                            ');
        GotoXY(18,22); Write('There are no more entries matching "',Param2,'"');
        GotoXY(25,23); Write('Press <SPACE> to continue...');
        Repeat
              Decision := ReadKey;
              Decision := Upcase(Decision);
              If (Decision = #32) then
              Begin
                   DecisionMade := True;
              End;
        Until DecisionMade;
        CursorOn;
End; (* SearchPerson *)

Other Threads