KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Dealing with corrupted Forms and Methods
PRODUCT: 4D | VERSION: | PLATFORM:
Published On: August 20, 1999

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:


  1. Copy the contents of the method.
  2. 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.
  3. Delete the method from the structure file.
  4. 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.
  5. Copy the method from the text editor.
  6. Create a new method in 4D with the same name as the original method.
  7. Paste the text back in the method.


To fix a form:

  1. Copy the contents of the form and paste them into a brand new form. This will force 4D to rebuild the form.
  2. Delete the old form and compact the structure file.
  3. 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.
  4. 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.
  5. 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:

    1. Open the Explorer.
    2. 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).
    3. Select the form and delete the form.
    4. Compact the structure file.