GetContextService – PB Docs 150

GetContextService PowerScript function

Description

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

Controls

Any object

Syntax

Argument

Description

servicename

String specifying the service object.
Valid values are:

  • ContextInformation – Context
    information service

  • ContextKeyword or Keyword– Context keyword
    service (use Keyword as the servicename on
    all EAServer platforms except
    AIX)

  • CORBACurrent – CORBA current service for
    client- or component-management of EAServer transactions

  • ErrorLogging – Error logging service for
    PowerBuilder components running in a transaction server such as EAServer or COM+

  • Internet – Internet service

  • SSLServiceProvider – SSL service provider
    service that allows PowerBuilder clients to establish SSL connections
    to EAServer components

  • TransactionServer – Transaction server
    service for PowerBuilder components running in a transaction server such
    as EAServer or COM+

servicereference

PowerObject into which the function places
a reference to the service object specified by servicename. This
argument is passed by reference.

Return Values

Integer. Returns 1 if the function succeeds
and a negative integer if an error occurs. The return value -1 indicates
an unspecified error.

Usage

Call this function to establish a reference to a service object,
allowing you to access methods and properties in the service object.
You must call this function before calling service object functions.

In Windows applications, you can use ContextKeyword or Keyword
as the servicename argument when you get an instance of the ContextKeyword service.
On all EAServer platforms
except AIX, you must use Keyword.

note.png Using a CREATE statement

You can instantiate these objects 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.

Examples

This example calls the GetContextService function
and displays the class of the service in a single line edit box:

See Also


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