Defining the access level
In the Prototype window, use the drop-down list labeled Access
to specify where you can call the function in the application.
For global functions
Global functions can always be called anywhere in the
application. In PowerBuilder terms, they are public. When you are
defining a global function, you cannot modify the access level; the
field is read-only.
For object-level
functions
You can restrict access to an object-level function by setting
its access level.
|
Access |
Means you can call the function |
|---|---|
|
Public |
In any script in the application. |
|
Private |
Only in scripts for events in the object in which |
|
Protected |
Only in scripts for the object in which the |
If a function is to be used only internally within an object,
you should define its access as private or protected. This ensures
that the function is never called inappropriately from outside the
object. In object-oriented terms, defining a function as protected or
private encapsulates the function within the object.