Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : Handle method calls
 

Handle method calls

To invoke (execute) a handle method, use the following syntax:

Syntax

widget-reference : method-name ( [ parameter-list ] )
  [ IN container-widget-name ]
The widget-reference is a reference to a handle-based object (see Handle-basedreferences). The method-name specifies the ABL-defined name of a handle method, and parameter-list specifies any parameter list for the method. The container-widget-name is a name reference to a static container for a static widget. You need it only if the static widget reference is ambiguous, as shown in the following example. To execute a handle method, you can assign the return value directly to a variable, include the method in an expression, or directly invoke the method as a statement (terminated with a period), ignoring its return value. For more information on calling handle methods, see Accessing handle attributes and methods.
The following example executes the ADD-FIRST( ) method for a selection list (Select-1) in two different ways—assigning the return value to a logical variable (methRtn) and invoking it directly, without assigning a value:
DEFINE VARIABLE Select-1 AS CHARACTER NO-UNDO
  VIEW-AS SELECTION-LIST SIZE 50.0 BY 10.0.
DEFINE VARIABLE methRtn  AS LOGICAL   NO-UNDO.

DEFINE FRAME SelectFrameA Select-1.
DEFINE FRAME SelectFrameB Select-1.

methRtn = Select-1:ADD-FIRST("BLUE") IN FRAME SelectFrameA.
Select-1:ADD-FIRST("GREEN") IN FRAME SelectFrameB.
* Error handling for handle method calls