Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Writing application-level scripts – PB Docs 90 – PowerBuilder Library

Writing application-level scripts – PB Docs 90

Writing application-level scripts

When a user runs an application, an Open event
is triggered in the Application object. The script you write for
the Open event initiates the activity in the application. Typically
it sets up the environment and opens the initial window. For a server
component, there may be no application-level scripts.

When a user ends an application, a Close event
is triggered in the Application object. The script you write for
the Close event usually does all the cleanup required, such as closing
a database or writing a preferences file.

If there are serious errors during execution,
a SystemError event is triggered in the Application object.

note.gif Batch applications If your application performs only batch processing, all processing
takes place in the script for the application Open event.

Table 4-1 lists
all events that can occur in the Application object (the ConnectionBegin
and ConnectionEnd events are obsolete). The only event that requires
a script is Open.

Table 4-1: Events in the Application object
Event Occurs when
Open The user starts the application.
Close The user closes the application. Typically,
you write a script for this event that shuts everything down (such
as closing the database connection and writing out a preferences
file).
SystemError A serious error occurs during execution
(such as trying to open a nonexistent window). If there is no script
for this event, PowerBuilder displays a message box with the PowerBuilder error
number and message text. If there is a script, PowerBuilder executes
the script.

For more about error handling, see “Handling errors during execution”.

Idle The Idle PowerScript function has been
called and the specified number of seconds has elapsed with no mouse
or keyboard activity.

Setting application properties in scripts

The Application object has several properties that specify
application-level properties. For example, the property ToolbarText
specifies whether text displays on toolbars in an MDI application.

You can reference these properties in any script
in the application using this syntax:

For example, to specify that text displays on toolbars in
the Test application, code this in a script:

If the script is in the Application object itself, you do
not need to qualify the property name with the application name.

note.gif Application name cannot be changed The name of an application is one of the Application object’s
properties, but you cannot change it.

For a complete list of the properties of the
Application object, see Objects and Controls
.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x