Solved

What is unit "Generics.Collections" ?

Posted on 2014-10-08
8
1,104 Views
Last Modified: 2014-10-16
hello, I've found a Delphi unit for implementing the AhoCorasick string search algorithm on this site:

https://gist.github.com/madhurjain/10067345

... but it makes a call to a unit "Generics.Collections" that my Delphi 7 compiler doesn't like ("File not found : "Generics.Collections.dcu"). Is this because my Delphi 7 is too old? Is there a workaround...?

Thanks!
    Shawn
0
Comment
Question by:shawn857
8 Comments
 
LVL 9

Assisted Solution

by:bas2754
bas2754 earned 250 total points
ID: 40369540
It does not appear to be available in Delphi 7.  About halfway down this page (http://edn.embarcadero.com/article/39136) it discusses this is implemented in Delphi 2009.

Look for Section 7: Generics

Looks like an upgrade may be in your future.
0
 

Author Comment

by:shawn857
ID: 40369657
Thanks Bas... yeah maybe I'll have to sooner than I figured. I did find the Generics.Collections.dcu compiled unit file while googling around. Do you think if I just added this file to my Search Path and compiled my project, it might somehow work??

Thanks
   Shawn
0
 
LVL 26

Expert Comment

by:Sinisa Vuk
ID: 40370056
No, it is not good to put this file - because it is compiled with another version of Delphi and needs compatible units. Workaroud is to try to make unit compatible to older Delphi. If you get stuck - ask for help here.

Add: Similar search algorithm: Boyer-Moore-Horspool
0
 

Author Comment

by:shawn857
ID: 40370075
OK thank you Sinisa. I think mainly what I need from the Generics.Collections unit is the Queue and Stack capability. Do you know if there's maybe a 3rd party implementation of these data structures for D7?

Also regarding the Boyer-Moore-Horspool method - I looked at that one already and it's not suitable for me as it searches for only one pattern in the target string. I need to be able to search for multiple patterns in the target string.

Thanks!
   Shawn
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:MerijnB
ID: 40370190
Queue and Stack do exists in D7 iirc, but not a generic queue and stack.

Generics is a mechanism which the compiler needs to support, you can not build or use it if it's not in the compiler, read this for more information.
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 40372736
there is a queue and stack type in the contnrs unit.
0
 

Author Comment

by:shawn857
ID: 40374015
what is the difference between the "generic" queue and stack, and the queue and stack found in D7's contnrs unit?

Thanks
   Shawn
0
 
LVL 19

Accepted Solution

by:
MerijnB earned 250 total points
ID: 40376539
what is the difference between the "generic" queue and stack, and the queue and stack found in D7's contnrs unit?

To put it simply, the queue and stack from D7 works with TObject or pointer, while with generic's you can make a queue and stack for a specific type of object, so you don't need to typecast (and can't make mistakes, etc).
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now