Solved

Library Search Path

Posted on 2003-12-08
9
383 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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 …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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