Dave Murray wrote: > Hi Thomas, > > Sounds like a much cleverer solution. I'm not sure what you mean by an > associative hash or how I would create it and test the serial numbers > against it. I know a little about using hash functions in cryptography > and signing but only in very basic terms. > > I don't run both queries for every label, it depends on which part is > being printed. There are a couple of dozen different parts that can be > produced by the app. > > Thanks, > Dave. > > Dave Murray > Delphi-En Moderator > Glasgow, UK > [EMAIL PROTECTED]
An associative hash is not the same thing as a cryptographic hash. An associative hash is a data structure that implements a B-tree and thus has O(log n) insert and search times. I've found them to be resource-friendly and very high-performance (partly why they are used to implement database indexes). Look up "stl map" on Google. I know it isn't Delphi, but that's the data structure I'm referring to (and there are examples of how to use stl map). Apparently JEDI has 'JclStrHashMap' which supposedly implements a string-based associative hash (but I didn't see any example code using it, but it should be similar to stl map). The following page showed up when running a Google search for "JclStrHashMap": http://www.koders.com/delphi/fid02907AFF1132DABC5F684C899D2D01D7D72FEBEC.aspx An associative hash will be sufficient for what you need to do and you'll see a considerable performance boost even with slowpoke Access. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 Safe C++ Design Principles (First Edition) Learn how to write memory leak-free, secure, portable, and user-friendly software. Learn more and view a sample chapter: http://www.CubicleSoft.com/SafeCPPDesign/ ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

