Hi Guy

Not much more to add.

With reference to the reply by Dennis

  • Create the sub-class in a separate package
  • Use the sub class package in the relevant views
  • Change the class name of the forms that need the extended functionality
  • Add the Broadcast command after the save request.


cCustomForm will do everything a standard form does but also understands / responds to the CustomClearForm message.

When I converted from procedural to OOP it took me quite a while to realise that “method” is just another name for “function” or “procedure” and that sending “messages” to objects is just a way to direct program execution to a method. The broadcast command is just a way to get the runtime to send the same message to all object or a subset of objects.

Once you get your head around it, sub-classing is very powerful. As an example, I have a menu option to change the user that is logged in without restarting the application and another to reset to the original user. These menu items broadcast a security check message from the desktop with the Recursive and NoStop options, so the message is sent to every object in the application. My menu item / view / dialog / tab page sub-classes all understand this message. Views / dialogs close and menu items / tab pages hide if the new user does not have rights. If a user needs support and I change user to me, I do not need to keep track of all the views etc I open because clicking on the Reset User menu item will automatically close / hide anything that user does not have rights to. As long as I create menu items / views / dialogs / etc “as” my sub-classes the security model is always respected – create the code once and then forget about it.

Regards
Ian