Sometimes forms and methods get corrupted. When a method is corrupted it will exhibit behaviors such as it will not tokenize correctly and the compiler may report errors that make no sense. When a form is corrupted, it may display strange results such as a subform will not work correctly or the Tool Tips might not show up.
To fix a method:
- Copy the contents of the method.
- Paste the contents of the method into a simple word-processor/text editor that can display invisible characters. Remove any characters that look out of place. Often the corrupted parts of the method will have strange characters displayed in their place.
- Delete the method from the structure file.
- Compact the structure file. This step is very important. 4D only marks objects as deleted and does not delete the object. 4D will then later reuse the space in memory that contained the object. If you do not compact the structure file, it might pass along the corruption to the next object.
- Copy the method from the text editor.
- Create a new method in 4D with the same name as the original method.
- Paste the text back in the method.
To fix a form:
- Copy the contents of the form and paste them into a brand new form. This will force 4D to rebuild the form.
- Delete the old form and compact the structure file.
- If the problem with the form still exits, you might want to try recreating the form a few pieces at a time. Do this by creating a new form and copying a few objects of the form at a time to the new form. Test the new form each time after adding the new objects.
- If the new form still has problems, you might want to create a completely new form with no objects from the old form. To make your job easier, you might want to take a screen shot of the old form and paste this into the new form to act as a guide when creating the form.
- If a form is really corrupted it may crash 4D when it is displayed. The only option is to remove the form. To do this:
- Open the Explorer.
- Click on the toggle so that the Explorer does not display the contents of the object (the part of the window that expands to the right).
- Select the form and delete the form.
- Compact the structure file.
- Open the Explorer.