Skip to content

New Base Class Methods

DataFlex 12.1 introduces new methods in the base classes of the runtime: CanCopy, CanCut, CanDelete, CanPaste, CanRedo, CanSelect, and CanUndo.

Most developers are not impacted when new methods are added to the base classes. However, it is possible for these new methods to change application behavior under the following conditions:

  • You use custom methods that have the same names as the newly added methods.
  • Your use of your custom methods relies on delegation.

Note: Both conditions must be met for there to be an application-level impact.

Example

Let's say that you have an object hierarchy like this:

oDialog is a dbModalPanel
oTree is a cTreeView

Now, suppose you have a function called CanDelete defined in oDialog, as shown below:

Object oDialog is a dbModalPanel
    Function CanDelete
End_Function
End_Object

Object oTree is a cTreeView
End_Object

Using delegation, you can call CanDelete from oTree simply by doing Get CanDelete. The system will check if oTree understands CanDelete; if not, it will delegate to the parent object. In this case, since oTree doesn't understand CanDelete, it delegates to oDialog, where it's understood. Your application works in a specific manner.

A revision of DataFlex adds new methods to some of the base classes in the runtime (including the base class for cTreeView), introducing a new function CanDelete. This time, when you call CanDelete from oTree, the object will understand CanDelete directly, so it won't delegate anymore. As a result, you get completely different behavior, as it's invoking CanDelete in oTree instead of delegating to oDialog.

If your use of CanDelete did not rely on delegation, or if your custom function was named differently, there will be no change in application behavior.

See Also