Board index » delphi » string search

string search

I was wondering if anyone could tell me how to record some data (ie.
part name, part no., quantity, price, location) to a file and then be
able to search for one word like the name or part no. and it brings up
the whole block of data.
Any help world be very appreacated.
 

Re:string search


Quote
rnjd...@netcom.NOSPAM.ca (Night) wrote:
>I was wondering if anyone could tell me how to record some data (ie.
>part name, part no., quantity, price, location) to a file and then be
>able to search for one word like the name or part no. and it brings up
>the whole block of data.
>Any help world be very appreacated.

You use a Pascal TYPED FILE to make a file of records. You can either
search the file itself in random order or read the file to an array of
records. You read a whole record at the same time into a variable such as
PartRec. If you are searching for a string PartName, you would:

     While (not eof(f)) AND (not found) Do
     Begin
        Read(f, PartRec); {which retrieves the whole record from file f}
        found := PartRec.PartName = SearchTarget  
        If found then Show(PartRec); {You make the procedure "Show"}
     End;    

I will send you an on hand demo by email.

Regards,
Clif   <clifp...@airmail.net>

Re:string search


_______________________________________________________________________________
___

Try Our ALL NEW Phone Sex Line... Choose from a wide variety of Fantasy's,
including Hard
Core {*word*275}s, New York {*word*249}s, Sweet Tight {*word*269}s aGIGO+ sn 452 at craybbs vsn
0.99.970109 060fd171

_______________________________________________________________________________
___

Try Our ALL NEW Phone Sex Line... Choose from a wide variety of Fantasy's,
including Hard
Core {*word*275}s, New York {*word*249}s, Sweet Tight {*word*269}s aGIGO+ sn 452 at craybbs vsn
0.99.970109 18c713e7

_______________________________________________________________________________
___

Try Our ALL NEW Phone Sex Line... Choose from a wide variety of Fantasy's,
including Hard
Core {*word*275}s, New York {*word*249}s, Sweet Tight {*word*269}s aGIGO+ sn 452 at craybbs vsn
0.99.970109 UUCP
From: clifp...@airmail.net (Clif Penn)
Subject: Re: string search

Quote
rnjd...@netcom.NOSPAM.ca (Night) wrote:
>I was wondering if anyone could tell me how to record some data (ie.
>part name, part no., quantity, price, location) to a file and then be
>able to search for one word like the name or part no. and it brings up
>the whole block of data.
>Any help world be very appreacated.

You use a Pascal TYPED FILE to make a file of records. You can either
search the file itself in random order or read the file to an array of
records. You read a whole record at the same time into a variable such as
PartRec. If you are searching for a string PartName, you would:

     While (not eof(f)) AND (not found) Do
     Begin
        Read(f, PartRec); {which retrieves the whole record from file f}
        found := PartRec.PartName = SearchTarget  
        If found then Show(PartRec); {You make the procedure "Show"}
     End;    

I will send you an on hand demo by email.

Regards,
Clif   <clifp...@airmail.net>

Other Threads