Copied Delphi projects doesn't use new directory - delphi

Delphi Rio. I have a project I have worked on called PasteParser. I am now wanting to create a new project called Clarity which is similar to PasteParser. So outside of Delphi, I copy the PasteParser entire directory structure to a directory called Clarity. I start Delphi, and open the project CALLED PasteParser in the Clarity directory. I right click on the project name, and select rename. I save, close the project, and reopen...The project now has the right name, and I am thinking all is good. I move a few buttons around, compile and then run. What comes up is the ORIGINAL program. What I am finding is that even though I have a new directory, and a new project, the project seems to have hard-coded the PasteParser directory into the files the the project uses. I look at Clarity Project Source, and none of the files have a hard coded directory.
Why is the Clarity project still using the Main.pas, etc. files from the PasteParser project?
*** FOLLOWUP: The only place (to my knowledge) which shows what files are in the project is the .dpr file. Here is the file contents. Note that the glib_ files are correct in their location. The remaining files do NOT have a directory listed, so they should be using the Clarity directory, yet they are not.
Here is the View/Project Source listing...
program Clarity;
uses
Vcl.Forms,
MainPas in 'MainPas.pas' {Main},
ParserUtils in 'ParserUtils.pas',
ParserGlobals in 'ParserGlobals.pas',
helpPas in 'helpPas.pas' {help_form},
FormatsWinPas in 'FormatsWinPas.pas' {FormatsForm},
ParseContacts in 'V1\ParseContacts.pas',
ParseOpps in 'V1\ParseOpps.pas',
ParseSalesActivities in 'V1\ParseSalesActivities.pas',
ParseSR in 'V1\ParseSR.pas',
Parse_IB_TABLE in 'V2\Parse_IB_TABLE.pas',
StatusBar_Utils in 'StatusBar_Utils.pas',
RB_Class in 'RB_Class.pas',
glib_excel in 'D:\VCL_RIO\MISC\GLIB2\glib_excel.pas',
glib_globals in 'D:\VCL_RIO\MISC\GLIB2\glib_globals.pas',
glib_utils in 'D:\VCL_RIO\MISC\GLIB2\glib_utils.pas',
glib_ORCL in 'D:\VCL_RIO\MISC\GLIB2\glib_ORCL.pas';

Try to delete all *.dproj.local, *.identcache, *.dsk from the new project directory

The only way I could get this to work is by opening my project, and then in the projects window (which lists all of my pas/dfm files), right click on each of the pas files and choose 'Save As', and giving it the new location.

Related

Changing file path in .dpr file in delphi

We are using Delphi 6. Currently, we have kept all the different application folders under one main folder.
We have below folder path for one of the applications:
C:\dev_GIT\MyApplications\Delphi\Sales_Applications\Member_Joining
For some reason, we would like to move this folder to below folder path:
C:\dev_GIT\Member_Joining
Issue we are getting is that we have some common files which are kept in separate folders and which are used in so many other applications as well.
Since we are moving this folder outside of the current folder path, we are getting compile error, which is expected.
The real issue is, as there are so many files which are in common folder path, we need to change their path in .DPR file one by one. Is there any better way by which we need not to change path for all the files in the .DPR file?

Delphi .PAS code reverts to the previous code after compile/build

I have a .BPG project which has a collection of .DPR project files.
Opened a .PAS file
I changed some line of code in a .PAS file of an project.
Saved it
After changing the source code, I tried COMPILE on that project.
First it says "Compiled" successfully.
Now I see the same .PAS file, the changes were lost. Codes changed at step 2 was lost. It is having the previous code only.
The behavior is same for BUILD too.
Anyone knows about this problem?
Thanks in advance.
Update
One more hint:
.DPR Project Name is XX.dll In IDE, there is one file with name XX_TLB.PAS in that project. In this file only I tried to change some code, which got reverted after compiling/building. Now I tried to rename this file, which gave me a error message
Type Libraries must have the tlb extention.
Also can the .DCU and .PAS files be in the same directory? I entered this directory (where both .PAS and .DCU files exist) into the directories list under "Tools->Options->Delphi Options->Library - Win32"
XX_TLB.PAS files are protected files. Do not edit such files directly. In fact there is note on top of the file warning you from editing the file.
They are regenerated each time the type library is refreshed.
See Code Generated When You Import Type Library Information.
This refresh could be done by the IDE each time you compile/build your dll.
You will never edit this file because of the dependencies of a type library and registered com objects. Either you change the com object itself via the type library editor, or create a new unit that interacts with your ActiveX class.
The Delphi IDE doesn't undo changes, as a general rule. There's notable exception. When you create an empty event handler, and then save the source file, the IDE will remove that event handler. Perhaps that's what is happening.
The other possibility that occurs to me is that you have multiple copies of the file. I've known the following to happen:
You create a package containing Unit1.
You install the package.
You then make another project that contains a different Unit1. Perhaps a copy of the file in a different location, so that it looks like the same unit.
You then modify the copy of Unit1, but the IDE sometimes prefers to open the file from the package.
The bottom line is that beyond deleting empty event handlers the IDE won't undo your changes. So it seems extremely likely that you have multiple copies of the file. To get to the bottom of this, you need to get the full path to the file. In the IDE, hover over the tab with the filename and the IDE will display the full path in a hint. I suspect you'll find that you have two distinct files.

move an xcode 4.5.1 project to different folder

I have created a rather large application in xcode and wish to move the files somewhere else on my computer.
Could this process be as simple as dragging the project folder to a different place in finder or will something mess up?
Moving the .xcodeproj files will not cause any issues as long as xcode is closed when you migrate the files and you delete the old files.
When xcode is next launched, if you browse and open the proj file from the new directory, all the references will be set to the correct destinations
on a side note it always pays to keep the old files in a .old folder when migrating projects to avoid issues.
As long as the files are kept in their respective folders, next time you run a build in xcode, the references to the new directory the proj file is in will be updated.
As another side note, i just tried to do this and it messed up for me. Typically, any references will switch over, but i had a linker error: ld. it was trying to link to an external library that was contained within the old folder. i had to go to build settings->search paths->library search paths and change that to the new folder location. that worked for me.

Textmate and add existing files

I don't understand why when I add files to my project using add existing files from project try it does not copy the file to my project, it just copies the reference to the file.
In TextMate, a project is nothing more than a collection of references to files you can edit simultaneously. It enables you to have them open in a drawer and as tabs as you will most certainly know already. But a TextMate project is not intended to be a file manager. More information on handling files inside a project can be found at the TextMate manual.
Add the folder to your project drawer on the left then you will be able to drag the files from there into your Rails project.
I was running to the same problem with trying to add existing files to a folder in my project, it would not change the reference.

Adding components to a component folder

I'm working on a Delphi project and I want to add a parser to it. The parser comes with components that should be added to the project
So it works great if I add the files to the same folder that my project is in, but I would like it to be in a separate components folder (to keep it cleaner, since I'm not going to be modifying those files anyway).
However, when I add create a components folder and add the files there, when I add it to the project through delphi, it has trouble finding the files. So it adds the .psu files to the right folder, but it says it can't find the unit 'Calculator', for example, until I copy the Calculator.dcu file from the component directory to the source directory.
How do I tell Delphi to look for those files where I put them?
Thanks
You have some options:
Add the units folder to the Projects' Search Path (Menu: Project\Options...) - only affects the project you're working now.
Add the units folder to the Environment's Library Path (Menu: Tools\Options...\Environment Options\Delphi Options\Library - Win32) if you want all projects in this ide install to find that units (not only the project you are working).
Just to complement: if, in the near future, you add components to your pallete and the compilation fail not finding the units; you'll have to update your system path as well. For details give a search on SO on this, as this is a common source of questions on the delphi tag... ;-)
Take a look at the Search Path for the project in the project options. Make sure your .pas and/or .dcu files are in that search path, i.e. add the folder in which the units are to your project's search path.

Resources