Changing file path in .dpr file in delphi - 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?

Related

Copied Delphi projects doesn't use new directory

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.

How to retrieve a list of .wav files in specific directory [duplicate]

This question already has answers here:
Swift - How do I get the file path inside a folder
(2 answers)
Closed 5 years ago.
I created a directory underneath my main project folder in XCode named Sounds.
I then dragged 8 audio files of type wav into the Sounds folder.
I ensured to check Copy items if needed when prompted by the dialog.
I'm currently attempting to retrieve a list of all wavfiles located in the Sounds directory.
I've attempted this a number of different ways, but below is the most recent.
Bundle.main.paths(forResourcesOfType: "wav", inDirectory: "Sounds")
The above code, as well as my other attempts have either yielded nil or an empty array.
So my question is, how can I retrieve a list of all files of type wav from the Sounds directory?
Furthermore, I'm a little unclear on the iOS directory structure.
For example, whats the different between the directory listings located in Bundle.main and the DocumentDirectory?
I have edited my question as I incorrectly implied that Sounds folder was located in the root directory.
I created a directory in the root of my project named Sounds
That sounds like the problem right there. You need a folder reference — and instead you created a group.
Here's the correct procedure:
In the Finder, create a folder somewhere, named Sounds. Now drag that folder into your project window's project navigator, and when you do, look carefully at the dialog that appears. You need it to look like this (note the crucial designation as a folder reference):
You'll know you've got it right because the folder icon in the project navigator will be blue:
Confirm that you've done it right by checking that the Sounds folder appears in the Copy Bundle Resource build phase:
Now your strategy will work: Drag files from the Finder into that blue folder in the project navigator, and they will be copied into the real "Sounds" folder. The "Sounds" folder itself will be copied into your app bundle at build time, and you can refer to its contents in code using ordinary FileManager methods.

iOS - how do I include javascript files that can be referred by relative paths to project?

Basically I want to use relative path in my html and js files that I imported to the project. It seems that xcode puts those bundle files all at the same level if I import files as group reference. So if I then get rid of all relative paths in my code it would work. But if I import them as folder reference as following links suggested none of those files will appear in Copy Bundle Resources (neither in compiled sources).
Load resources from relative path using local html in uiwebview
UIWebView doesn't load external Javascript file
Any help will be appreciated.
I managed to resolve my issue. What I did wrong was import the entire folder as folder reference that would expose the folder appearing in the root directory as the result. I could refer every files with that directory (e.g. root/js/abc.js) but that'd be bad.
I don't know if it's the best way to resolve but here is what I have done. I created one group and put everything else in that group except importing all sub folders as folder references. In that way all files in the root group can use relative paths without errors.
Note: all the files in the folder reference still don't appear in bundle resources and I still don't know how other people (in the links I posted) got it done.
You could put your front-end files into a real folder, then add the folder to your XCode project(don't forget to check "copy if needed", not as reference).

Moving files around in XCode and IOS 7

I move some files into a subdirectory but now I get linking errors saying files can't be found. Where do I go (like a projects file) to tell XCODE where to look for the new files?
I tried removing everything and adding them back in but I still get missing files even though they are one directory in and added to the project.
Select a file in left panel, open inspector panel on the right and choose a path to file there.
Note: it's more efficient to do that if your files are organized into folders; that way, you only need to change the path to folder and the elements are relative to it.

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