Description
In PowerBuilder 7, you work with user events in the Event List and Script views. Defining user events is similar to defining object-level functions.
Usage
When you add a new event, a Prototype window displays above the script in the Script view. You can hide the Prototype window using the toggle button to the right of the listboxes at the top of the Script view. There are two toggle buttons: the button on the right hides or displays the Error window.
The fields in the Prototype window are in the same order as the event's signature: access level, return type, and name, and then for each parameter, how it is passed, its data type, and its name. You can choose to map the user event to a PowerBuilder message ID by selecting an ID from the dropdown listbox at the bottom of the Prototype window. If you map the event to an ID, you cannot change the return type and arguments.

|
To do this
|
Do this
|
|
Define a user event
|
Select Insert>Event from the menu bar or, in the Script view, select [New Event] from the second dropdown list, or in the Event List view, select Add from the popup menu
|
|
Open an event for editing
|
In the Event List view, double-click the event's name
|
|
Delete a user event
|
In the Event List view, select the user event's name, then select Delete from the Edit or popup menu
|
|
Save a user event
|
In the Prototype window, define the user event's name and tab to the next field. The user event is added to the Event List view and saved as part of the object when you save the object
|
|
Add, insert, or delete parameters in a user event
|
Click the Prototype toggle button in the Script view to open the Prototype window if it is hidden. In the Prototype window, select Add, Insert, or Delete Parameter from the popup menu
|
|
Mark an event for use in a generated component
|
In the Prototype window, check the External checkbox
|
See also
Writing scripts Declaring variables and external functions Defining functions Using AutoScript
|