How you create a new function depends on whether you are defining a global function or an object-level function.
To create a new global function:
Select File>New from the menu bar and select Function from the PB Object tab
The Function painter opens, displaying a Script view with an open Prototype window in which you define the function.
To create a new object-level function:
Open the object for which you want to declare a function.
You can declare functions for windows, menus, user objects, or applications.
Select Insert>Function from the menu bar, or select Add from the Function List view pop-up menu.
The Prototype window opens in a Script view.