?
Solved

Library Search Path

Posted on 2003-12-08
9
Medium Priority
?
393 Views
Last Modified: 2010-04-05
Hi,

How should I manage the Library Search Path. It's the folders where the components are.
The problem is that I've lots of components. So I put them all in the same directory. Whatelse if I create a directory per component, then the library search path couldn't have all the directory.
Can anyone give a good idea or a trick to put my library in order, and don't stay in a complete chaos.
Thanks,
Luis
0
Comment
Question by:lfgmartins
7 Comments
 
LVL 8

Accepted Solution

by:
gmayo earned 500 total points
ID: 9896031
You can have more than one path. Click on the ... next to the search path box and add each seperate path. They'll come up seperated by semicolons (eg 'C:\ProjA;C:\ProjB'). At least I *think* that's what you're talking about...

Geoff M.
0
 
LVL 27

Assisted Solution

by:kretzschmar
kretzschmar earned 500 total points
ID: 9896067
yep, geoff is right,
you could also use the sub-dialog, which somes up,
if you press the ...-button
0
 
LVL 17

Assisted Solution

by:Wim ten Brink
Wim ten Brink earned 500 total points
ID: 9896143
The use of multiple paths is the best way to use the library path, however it will slow down some things within Delphi itself, like compilation. Now, if you have a fast machine then you won't notice much about it but otherwise there is a nice trick you can do by making packages part of your project.

Since your components are probably part of packages, you can install and uninstall these packages quite easily, whenever needed. Therefore, I split my components up in two groups. One group are the global components for which the path is set by Tools/Environment options/Library and the other group are actually project-related packages, meaning that these components are often used by only one or two of my projects. For these packages I just set the Project/Options/Search path to look to the location of my package source. The package will output all DCU's to the same folder as my project itself so my project can easily find these components. Now, all I have to do to get the project working is to install the package.
And packages are part of a project group so installation is easy.

Now, what if a component set is part of multiple projects? Personally, for security reasons I just keep a version of the package per project because if a package is changed, it might have unexpected effects on other projects that depend on the package. I've had more than enough bad experiences that my application couldn't compile anymore because another developer rewrote a function in one package and e.g. added an additional parameter or changed a type declaration. The package would then still work for HIS project but mine would just not work anymore.
So, personally I try to keep custom components close to my project. Which means I let them output the DCU's to the projects DCU folder.

About dividing your components over multiple folders, please do it in a logical way and make sure that related components share the same folder. Only keep the original Delphi libraries in their original location.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:lfgmartins
ID: 9896157
Hi all,

OK I understand that, but in my case I've around 100 components. I don't use them all. Thank god :) What's your recomendation for my case? Can I add 100 paths like F:\PROGRAM FILES\BORLAND\LIB\USR_COMPONETS\COMPONENT1 and the same for 2 and 3...
How will Delphi handle all these? What is the Delphi Path limit? Do you have any other idea?
Thanks,
Luis
0
 
LVL 8

Expert Comment

by:gmayo
ID: 9896325
You might be better off keeping the originals somewhere safe and just dumping a copy of all the components into one directory. It would be a PITA to set these paths up for every project.

100 might be ok, but it depends on how long each path name is.

Geoff M.
0
 
LVL 1

Assisted Solution

by:roknjohn
roknjohn earned 500 total points
ID: 9896823
I have two main folders for components.  MyComponents, for the components that I write myself, and a ThirdParty folder for those I acquire elsewhere.  There are many subfolders within the ThirdParty folder,  as I like to keep each component installation separate.  In other words, when ever I download a new component, I will create a new folder for it under ThirdParty.  However, in many cases I will COPY the .pas and/or .dcu files up to the ThirdParty folder in order to keep my library paths from being too numerous.  

0
 
LVL 8

Expert Comment

by:gmayo
ID: 9896928
Nice to hear somebody already does what I'm suggesting to Luis, John!

Cheers

Geoff M.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month13 days, 16 hours left to enroll

807 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