Solved

Library Search Path

Posted on 2003-12-08
9
381 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
9 Comments
 
LVL 8

Accepted Solution

by:
gmayo earned 125 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 125 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 125 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

13 Experts available now in Live!

Get 1:1 Help Now