PROCEDURE proc-name PRIVATE :procedure-body
PROCEDURE proc-nameEXTERNAL "dllname" CDECL PASCAL STDCALLORDINAL n PERSISTENTIN SUPER :procedure-bodyTo define the name of an internal ABL procedure that is an event handler for ActiveX controls (OCX event procedure), you must specify proc-name according to the following syntax:
control-frame-name.control-name.event-nameANYWHERE.event-name
EXTERNAL "dllname"Declares the internal procedure as a Windows DLL or UNIX shared library routine. The dllname argument, specified as a string literal, is the name of the DLL or library containing the routine. The value of dllname can contain Unicode characters. See OpenEdge Development: Internationalizing Applications for more information about Unicode.ORDINAL nSpecifies the number of the DLL entry point (the nth routine) to invoke. If you use the ORDINAL option, then proc-name can specify any name used in the corresponding RUN statement to reference the routine. If you omit the ORDINAL option, proc-name specifies which DLL routine you want to invoke.The body of an internal procedure definition. Define procedure-body using the following syntax:
procedure-logic
.
.
.catch-block catch-blockfinally-blockEND PROCEDURE .If you are defining the internal procedure for use as an event procedure to handle asynchronous remote requests, you can specify run-time parameters as INPUT only. (Any other type of parameter generates a run-time error.) Each INPUT parameter must correspond in order and data type with an OUTPUT (or INPUT-OUTPUT) parameter as defined in the remote procedure that executes the request. For more information on working with asynchronous remote requests and event procedures, see OpenEdge Application Server: Developing AppServer Applications.For more information on accessing DLL or UNIX shared library routines from ABL, see the chapter on DLLs in OpenEdge Development: Programming Interfaces.Specifies a CATCH statement that defines error handling code for one or more error types. A DO block does not have any default error handling. Therefore, a DO block must have error handling options specified such that it becomes an undoable block. Otherwise, ABL generates a compiler warning. For more information on catch-block, see the CATCH statement reference entry.Specifies a FINALLY statement that defines the processing that must occur after all other processing in the block occurs. For more information on finally-block, see the FINALLY statement reference entry.END PROCEDURESpecifies the end of the internal procedure body. If procedure-logic contains one or more statements, you must end the internal procedure body with the END statement.The following example declares a DLL routine, MessageBox(), which displays a message:
PROCEDURE atoi EXTERNAL "/usr/lib/libc.so.1":...
You can terminate a PROCEDURE statement with either a period (.) or a colon (:), but typically use a colon (:) for a procedure definition or prototype that includes procedure-body and a period (.) for a procedure definition or prototype that omits any procedure-body.
You can place an internal procedure definition or declaration before, after, or in the middle of your main procedure code. You cannot nest an internal procedure within another internal procedure.
Use the RUN statement to invoke an internal procedure. You can run an internal procedure from within the external procedure that defines it, either from the main-line of the external procedure or from another internal procedure defined in the external procedure. You can also run an internal procedure defined in another external procedure using the IN proc-handle option of the RUN statement as long as the external procedure meets one of these conditions:
To define the internal procedure as an event handler for ActiveX controls (OCX event procedure), you must specify proc-name according to the following syntax:
control-frame-name .control-name .event-nameANYWHERE .event-name
In control-frame-name.control-name.event-name, control-frame-name is the name (unquoted) of the control-frame that contains the ActiveX control. This is the name that the AppBuilder typically assigns to the control-frame (NAME widget attribute) when you insert the control into your user interface. The control-name is the value (unquoted) that you assign to the control Name property at design time in the AppBuilder Property Window. The event-name is the name (unquoted) of the ActiveX control event that you want to trigger execution of this procedure.In ANYWHERE.event-name, ANYWHERE specifies an event procedure that handles the specified event in any ActiveX control. This event procedure executes only if you have not defined a control-frame-name.control-name.event-name event procedure that exactly matches the control/event combination at run time.At design time, the AppBuilder lists the available events for a control and automatically creates a template for the OCX event procedure definition from the event that you select. For more information on how to create OCX event procedures in the AppBuilder, see the information on ActiveX controls in OpenEdge Development: Programming Interfaces. For more information on how to work with OCX event procedures in an application, see OpenEdge Development: Programming Interfaces.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |