Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

What is unit "Generics.Collections" ?

Posted on 2014-10-08
8
1,228 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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 video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
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…

860 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