Description
In PowerBuilder 7, you work with global functions in the Function painter and object-level functions in the Application, Window, User Object, and Menu painters.
Usage
Whether you're working with global or object-level functions, you work with the Script, Structure, and Structure list views. For object-level functions, you also use the Function List view.
When you add a new function, a Prototype window displays above the script in the Script view. The fields in the Prototype window are in the same order as the function's signature: access level, return type, name, and then for each parameter, how it is passed, its data type, and its name.

|
To do this
|
Do this
|
|
Show or hide the Prototype window
|
Click the toggle button to the right of the listboxes at the top of the view
|
|
Define a global function
|
Select File>New to open the New dialog box, then select Function from the Objects tab page
|
|
Open a global function for editing
|
Select File>Open to open the Open dialog box, select Function from the dropdown listbox, then select the function
|
|
Save a global function
|
Select File>Save or close the painter
|
|
Define an object-level function
|
Select Insert>Function from the menu bar or, in the Function List view, select Add from the popup menu
|
|
Open an object-level function for editing
|
Select the function from the dropdown listbox or in the Function List view, double-click the function
|
|
Delete an object-level function
|
In the Function List view, select the function and select Delete from the Edit or popup menu
|
|
Save an object-level function
|
In the Prototype window, define the function's name and scope. The function is added to the Function List view and saved as part of the object if its definition and script are complete when you save the object
|
|
Add, insert, or delete parameters in a global or object-level function
|
Click the Prototype toggle button in the Script view if the Prototype window is hidden. In the Prototype window, select Add, Insert, or Delete Parameter from the popup menu
|
|