Home > Back-end >  How to safely move ancestor form without breaking many inherited references?
How to safely move ancestor form without breaking many inherited references?

Time:02-26

I have a project with many forms. Most of those forms are inherited from one common base form. As new inherited forms are added, it became necessary to start arranging those forms inside subdirectories.

All of the inherited forms have been successfully placed in their appropriate subdirectories. However, the base ancestor form is still in the project root and needs to be moved into a Common subdirectory. Not so easy, without removing every single inherited form and re-adding them all again. I've faced this situation a few times before, and ended up just biting the bullet and doing it the hard way. But I'm curious if it can be any easier.

At least in Visual Studio, I was able to move things around like this from within the IDE. But Delphi does not support this.

What's the easiest way I can move the ancestor base form into a subdirectory while retaining all its inherited form references?

CodePudding user response:

You didn't specify the Delphi version you are using, but usually you can simply open the unit while working on the project and use Save As to create a copy in the desired folder. After that you can safely remove the files from its original place.

Another option that might work in your Delphi Version is editing the unit file name inside the Project Manager view. Specify a folder relative to the current position will move the unit to the new place. See How to reorganize the folder structure of my units in Delphi?

  • Related