Names of components and routines are important! Doing major software redesigns sometimes components are moved to other packages and/or are
renamed. This means that existing code must be changed in order to compile again.
I build a very nice Tool for projectwide replacements of multiple components and Tokens that saves you working through all the Steps below (GM - String Replacer).
If components have been renamed please follow the Steps below
- Make a Backup of the Projects containing GM-components.
- Start your compiler, close all projects and exit again (to avoid that your compiler opens any of your projects the next time
it is started).
- Uninstall the current version of the GM Packages from your compiler.
- Install the new version of the GM Packages to your compiler.
- DO NOT OPEN ANY OF YOUR PROJECTS NOW !!!
- Search the *.dfm Files on your Disk for files containing the old component Type names, for example "TDAOEdit". Use a GREP
Tool or the windows find for this search.
- Start your compiler, open the *.dfm Files containing old component type names directly using File/Open (open the *.dfm files not the
Projects!). The *.dfm Files will be opened in a textual representation. Use Find & Replace to replace the old component type name by the new one: replace "TDAOEdit" by "TGMDBEdit". DO NOT
OPEN ANY PROJECT AT THIS TIME.
- Save the changes you made to the *.dfm files and close them.
- Now open your projects. Bring up every Form you changed before. If properties have been dropped from some components the compiler will
ask you what do to with the existing property value. Just press ignore all. Make a minor change to all the Forms that are affected by the component type renaming (drag it some pixels in design mode). Now Save
your Project. The compiler detects the component Type mismatches and asks if they should be corrected. Answer Yes to all the message Boxes.
- Close and reopen the project. Now replace all occurences of the old data type names in the *.pas files of your project by the new
- Everything is fine again.
- The migration path outlined above will only work if the component properties of the renamed components are of the same datatype as
properties of the original components. Otherwise you will get an Error and the existing Property Value is Lost.
Answer the IDE error dialog with "Ignore All". It is the best you can do.
- Values of properties that have been dropped in the new components are lost.
- New properties of the renamed components will be set to their default Values.
- Since the TGMDaoDataset and the TGMAdoDataset have many properties in common the migration Path outlined above can be used to migrate
from DAO to ADO components and vice versa.
If Units have been renamed please follow the Steps below
- Search all your projects for the old Unit name and replace it by the new unit name.