Try OpenEdge Now
skip to main content
Object-oriented Programming
Programming with Class-based and Procedure Objects : Using handle-based object events in classes : SET-CALLBACK( ) method
 

SET-CALLBACK( ) method

The SET-CALLBACK( ) built-in method is used to associate a method and object reference with ABL-defined events on three objects:
*ProDataSet object
*Buffer object
*Query object
Note: You can also use SET-CALLBACK( ) to associate an internal procedure with a named ABL event.
This is the syntax for using SET-CALLBACK( ) to associate a method and object reference (or internal procedure and procedure handle) with a named ABL event:

Syntax

SET-CALLBACK ( callback-name, method-or-proc-name
  [ , method-or-proc-context] )
Element descriptions for this syntax diagram follow:
callback-name
A quoted string or character expression representing the name of a callback (named ABL event). The callback name is not case-sensitive. For information on the supported callbacks, see the SET-CALLBACK( ) method reference entry in OpenEdge Development: ABL Reference.
method-or-proc-name
A quoted string or character expression representing the name of an internal procedure or method that resides within method-or-proc-context.
method-or-proc-context
A reference to a class instance that contains the method specified by method-or-proc-name or a handle to a procedure that contains the internal procedure specified by method-or-proc-name. If not specified, THIS-PROCEDURE is used if SET-CALLBACK( ) is executed within a procedure, and THIS-OBJECT is used if SET-CALLBACK( ) is executed within a class.
Note: If method-or-proc-name represents a class method that is associated with an ABL event as a callback, and the method is overridden in a derived class, the overridden method is run when the callback is invoked.