D,
Have you considered using the kbmMemTable?
You can then normalise your data (ala any sql database)
Or would that be to slow? (Bear in mind that memory tables are orders of
magnitude
faster than disk based tables)
HTH
Neven
----- Original Message -----
From: "Donovan J. Edye" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Friday, 13 July 2001 17:12
Subject: [DUG]: How to approach this?
> All,
>
> I have to do the following:
>
> - Replace some numeric integers with string values in a string
> - The position of the integers the string may vary
> - It all has to be as fast as possible
>
> What we have are some paradox tables with the following format: (TPlayerID
> : integer)
>
> TableA
>
> PlayerID : TPlayerID
> FirstName : string;
> SecondName : string;
>
> TableB
>
> BatsmanID : TPlayerID
> BowlerID : TPlayerID
> Field1
> Field2
> Field3
> OtherBatsmanID : TPlayerID
> Field4
> etc.
>
> Assume we have the following TPlayerID - TPlayerCode mappings. TPlayerCode
> : string[5]
>
> 1 - ABCDE
> 2 - FGHIJ
> 3 - MNOPQ
>
> etc.
>
> If we get strings as follows - say read from a text file:
>
> PlayerID, FirstName, SecondName
> 3,John,Doe
> BatsmanID, BowlerID, Field1, Field2, Field3, OtherBatsmanID, Field4
> 1,3,a,b,c,2,e
> PlayerID, FirstName, SecondName
> 1,Paul,Smith
> BatsmanID, BowlerID, Field1, Field2, Field3, OtherBatsmanID, Field4
> 2,1,a,b,c,3,e
>
> Question 1:
>
> - What is the most efficient way to store the TPlayerID, TPlayerCode as a
> memory structure mappings so that:
> - Minimal memory footprint
> - Fastest searching
>
> The above mappings list does not generally change a lot. So "slow"
creation
> of the mapping list is not a big concern. Typically the mapping list is
> created once and accessed many. It is nominally read only.
>
> Question 2:
>
> - What is the most efficient way to replace a specific string with
another?
> So given:
>
> BatsmanID, BowlerID, Field1, Field2, Field3, OtherBatsmanID, Field4
> 1,3,a,b,c,2,e
>
> End up with
>
> BatsmanID, BowlerID, Field1, Field2, Field3, OtherBatsmanID, Field4
> ABCDE,MNOPQ,a,b,c,FGHIJ,e
>
>
> Comments, suggestions welcome. TIA
>
>
>
> -- Donovan
> ----------------------------------------------------------------------
> Donovan J. Edye [www.edye.wattle.id.au]
> Namadgi Systems [www.namsys.com.au]
> Voice: +61 2 6285-3460
> Fax: +61 2 6285-3459
> TVisualBasic = Class(None);
> Heard just before the 'Big Bang': "...Uh Oh...."
> ----------------------------------------------------------------------
> GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
> replacement. Also includes freeware delphi windows explorer components.
> ----------------------------------------------------------------------
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/