Solved

What is unit "Generics.Collections" ?

Posted on 2014-10-08
8
1,167 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

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
 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 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