Module_CalledEventHandlers

Type: Module Parent Module: N/A

Process all the methods that are window field event handlers and are also being used as called methods. This will not work in Studio because the methods will be converted by the core converter to field $event methods and the call to the method using its original Omnis 7 name will fail with a runtime error because a method of that name no longer exists. We need to create a new window class method for each one and move the code from these $event method to the new method and create a call to the new method from the $event method.

Functionality

Build a list of all event handler methods in this library that are called either from within this library or externally from another library. The fCalledEventHandlers file contains a record for each such method identified by the O$Converter library. This list is made from all available analyzer datafiles.

It is important to note that ALL analyzer datafiles must to be available in the SAME folder as the current library that is being converted because they may include external calls to this library. The list is sorted so that the library we are converting appears last in the list. This is to ensure that when we are processing the list, the library that is being converted is processed last, to ensure that the correct datafile is set after this module completes.

If a particular analyzer datafile is not found then a dialog window may be displayed to prompt you to locate the missing file. See the O$Converter Dialog Windows help page for more details.

For each called event handler field identified:

  1. Add a new class method with the same name as the field.
  2. Copy local variables and parameters from the old $event method to the new method.
  3. Copy all the code lines from the old $event method to the new method.
  4. Replace the code moved with a 'Do method' command to call the new class method.

This module needs to run before Module_MissingOnEvClicks because it does not separate out the 'On evClick' that would be placed at the top of the event handler methods. This is achieved by virtue of the modules names.

Assumptions

  1. This module does not separate out the 'On evClick' or other event tests that are usually found at the top of the method, though they wouldn't be expected in an event handler method that is also being called as a subroutine. If these commands are present then they would be moved to the new class method which is undesirable.

User Setup Required for this Module

None.