Tech Tip: Removing Excess Code
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: November 15, 2023
When converting databases that have been created in an older version of 4D, there can be relics of older code in the database that have not been removed, but should be to perform some house keeping.
For example, a database created in a very old database is now looking towards moving to a more current version of 4D. When performing the conversion, it can be helpful to remove any items that should not be looked at, this can reduce the time it takes to perform a "Find in Design", "Syntax Checks", "Generate Typing", ect.
The first and easiest items to remove are:
- Items in the Trash - If items are in the Trash, they are no longer being used, if the code is special for some reason, export them and save them outside of the database.
- Orphaned Methods - Methods can become orphaned in many ways due to legacy issues, one common way is when a form is deleted, but the link between a form method or object method with an object on the form was not properly intact causing the method to remain and become orphaned. In most cases, orphaned methods are not being used and can be deleted.
- Unused Methods - The last items that can be removed are unused methods. 4D Provides a feature that allows all methods that are not called else where to be quickly returned. Under the Design Mode menu bar > Edit Menu > Find Unused Methods and Global Variables. This will display a list of all methods and global variables that exist but are not called elsewhere.
This can help clean up the database a bit and allow the process of maintaining or converting a database to be a bit easier.