Syntax

ABL supports the following general .NET WAIT-FOR statement syntax to block for input on .NET forms (see also the .NET WAIT-FOR statement syntax in ABL Reference):

WAIT-FOR dotNET-input-blocking-method-call .

For all non-modal .NET forms (and all non-modal ABL windows and other features that generate events, such as sockets), you use a single instance of this statement that calls the static System.Windows.Forms.Application:Run( ) method. This statement blocks on one or more forms and processes all their events, as well as events for all non-modal ABL components. The difference between this .NET WAIT-FOR statement and a WAIT-FOR statement that processes only ABL events is that the .NET WAIT-FOR statement unblocks and terminates execution after the Application:Run( ) method returns. This method termination automatically closes all instantiated .NET forms. However, the ABL-only WAIT-FOR statement for ABL events terminates only when a specified ABL event is raised, and you must manually close all non-modal ABL windows that you associate with this statement (see the reference entry for the ABL-only WAIT-FOR statement in ABL Reference).

Note: You can also use the PROCESS EVENTS statement in an event handler or trigger to process all pending .NET and ABL events.

For each modal form, you use a single instance of the .NET WAIT-FOR statement that calls the ShowDialog( ) method on the associated form object. This statement displays the form as a dialog box and processes events only for that form until the form is closed, much like the ABL-only WAIT-FOR statement that displays and processes events for an ABL dialog box.

For more information on using the non-modal .NET WAIT-FOR statement, see Block on non-modal forms. For more information on using the modal .NET WAIT-FOR statement, see Block on modal dialog boxes.

Note: When blocked for input in .NET, keys mapped to END-ERROR in ABL are ignored. The same applies to APPLY END-ERROR. If you want to close a .NET window or dialog programmatically, call the proper method on the form or dialog.