Application object

An application is a collection of PowerBuilder windows and objects that provide functionality for user activities, such as order entry or accounting activities. The Application object is the entry point into the applications.

When a user runs an application, the Open event of the Application object is fired. The Open event triggers the script that initiates all the activity in the application.

Properties

Application

property

Datatype

Description

AppName

String

Specifies the name of the Application object.

ClassDefinition

PowerObject

An object of type PowerObject containing information about the class definition of the object or control.

DDETimeOut (Obsolete)

Integer

Specifies the number of seconds PowerBuilder acting as the DDE client waits before giving up when trying to communicate with a server using DDE (the default is 20 seconds).

DisplayName

String

User-readable name for your application. This name is displayed, for example, in OLE dialog boxes that show the application's name. If you do not specify a value, the value of AppName is used for DisplayName.

DWMessageTitle

String

Specifies the title of the message box for any runtime DataWindow errors encountered in the application. If you change the value of this property in script, the new value is recognized only for DataWindows created (or painted) after the new value is set.

FreeDBLibraries

Boolean

Specifies whether you want PowerBuilder to free database interface libraries upon disconnecting from the database. The default is FALSE (PowerBuilder does not free the libraries upon disconnecting).

HighDPIMode

Integer

Specifies the DPI (Dots Per Inch) awareness mode.

MicroHelpDefault

String

Specifies the default text of the MicroHelp object (the MicroHelp text that displays when you initiate a PowerBuilder session). The default is Ready.

RightToLeft

Boolean

Specifies that characters should be displayed in right-to-left order in MessageBoxes displayed when you call the MessageBox function. The application must be running on an operating system that supports right-to-left display. Values are:

TRUE -- Message box text displays in right-to-left order. The text of the MessageBox buttons displays in the language of the RightToLeft version of Windows (Arabic or Hebrew) only if you are running a localized version of PowerBuilder. Otherwise, the text of the MessageBox buttons displays in English.

FALSE -- Characters display in left-to-right order.

ToolbarFrameTitle

String

Specifies the text that displays as the title for the FrameBar when it is floating.

ToolbarPopMenuText

String

Allows you to change the toolbar location text (Left, Top, Right, Bottom, Floating) in the Application's toolbar pop-up menu. Specify the text as a comma-separated list of items.

ToolbarSheetTitle

String

Specifies the text that displays as the title for the SheetBar when it is floating.

ToolbarText

Boolean

Specifies whether the text associated with the items in the toolbar displays. Values are:

TRUE -- Text displays in toolbar.

FALSE -- Text does not display in toolbar.

ToolbarTips

Boolean

Specifies whether PowerTips display when text is not displayed on the buttons. Values are:

TRUE -- PowerTips are displayed.

FALSE -- PowerTips are not displayed.

ToolbarUserControl

Boolean

Specifies whether users can use the toolbar pop-up menu to hide or show the toolbars, move toolbars, or show text. Values are:

TRUE -- Users can use pop-up menu.

FALSE -- Users cannot use pop-up menu.


Events

Application event

Occurs

Close

When the user closes the application.

Idle

When the Idle function has been called in an Application object script and the specified number of seconds have elapsed with no mouse or keyboard activity.

Open

When the user runs the application.

SystemError

When a serious execution time error occurs (such as trying to open a nonexistent application). If there is no script for this event, PowerBuilder displays a message box with the PowerBuilder error number and error message text.

For information about error messages, see the section called “Using the SystemError and Error events” in Application Techniques.


Functions

Application function

Datatype returned

Description

BeginSession

Integer

Creates a session.

ClassName

String

Returns the class of the Application object.

GetContextService

Integer

Creates a reference to a context-specific instance of the specified service.

GetHttpRequestHeader (PowerServer)

String

Gets the HTTP request header, such as cookie.

GetHttpRequestHeaders (PowerServer)

String

Gets all of the request headers' information.

GetHttpResponseHeaders (PowerServer)

String

Gets all of the response headers' information.

GetHttpResponseStatusCode (PowerServer)

Long

Gets the response status code.

GetHttpResponseStatusText (PowerServer)

String

Gets the response status description.

GetParent

PowerObject

Returns a reference to the name of the parent object.

GetPowerServerURL (PowerServer)

String

Gets the root URL of the PowerServer Web APIs.

GetQuickAccessToolbarStatusPath

String

Gets the file path of the QuickAccessToolbar item status (QatItems.qat).

GetSessionID (PowerServer)

String

Returns the session ID of the current application client.

PostEvent

Boolean

Adds an event to the end of the message queue for the Application object.

SetHighDPIMode

Integer

Sets the DPI (Dots Per Inch) awareness mode.

SetHttpRequestHeader (PowerServer)

Integer

Sets the request header.

SetLibraryList

Integer

Sets the PBD library list in an executable. This function can still be used but should be replaced by the system function SetLibraryList.

SetPowerServerURL (PowerServer)

Integer

Sets the PowerServer root URL (the Web API URL) for the installable cloud application.

SetQuickAccessToolbarStatusPath

Integer

Sets the file path of the QuickAccessToolbar item status (QatItems.qat).

SetTransPool

Integer

Sets up a pool of database transactions for an application. SetTransPool allows you to minimize the overhead associated with database connections and also limit the total number of database connections permitted.

TriggerEvent

Integer

Triggers a specified event in the Application object and executes the script for the event.

TypeOf

Object

Returns the type of the Application object.