Context information
The PowerBuilder context feature allows applications to access
certain host (non-PowerBuilder) services. This is a PowerBuilder
implementation of functionality similar to the COM QueryInterface.
PowerBuilder provides access to the following host services:
PowerBuilder creates service objects appropriate for the current
execution context (native PowerBuilder or transaction server). This
allows your application to take full advantage of the execution
environment.
The context feature uses seven PowerBuilder service objects: ContextInformation,
ContextKeyword, CORBACurrent, ErrorLogging, Inet, SSLServiceProvider,
and TransactionServer; it also uses the InternetResult object. (The
context feature is sometimes called the Context object, but it is not a
PowerBuilder system object.)
For more information about these objects,
see Objects and Controls or the PowerBuilder
Browser.
Enabling a service
Before you use a service, you instantiate it by calling the GetContextService function.
When you call this function, PowerBuilder returns a reference to
the instantiated service. Use this reference in dot notation when
calling the service’s functions.
To enable a service:
-
Establish an instance variable of the appropriate
type:1ContextInformation icxinfo_base1ContextKeyword     icxk_base1CORBACurrent       corbcurr_base1ErrorLogging       erl_base1Inet               iinet_base1SSLServiceProvider sslsp_base1TransactionServer  ts_base -
Instantiate the instance variable by calling the GetContextService function:
1this.GetContextService("ContextInformation", &<br>   icxinfo_base)1this.GetContextService("ContextKeyword", icxk_base)<br>// Use Keyword instead of ContextKeyword on EAServer1this.GetContextService("Keyword", icxk_base)1this.GetContextService("CORBACurrent", &1   corbcurr_base)1this.GetContextService("ErrorLogging", erl_base)1this.GetContextService("Internet", iinet_base)1this.GetContextService("SSLServiceProvider", &1   sslsp_base)1this.GetContextService("TransactionServer",ts_base)
Using a CREATE statement
You can instantiate a service object with a PowerScript CREATE statement. However,
this always creates an object for the default context (native PowerBuilder
execution environment), regardless of where the application is running.