Context keyword service
Use the context keyword service to access environment information
for the current context. In the default environment, this service
returns host workstation environment variables.
Accessing environment
variables
When running in the PowerBuilder execution environment (the
default context), you use this service to return environment
variables.
To access environment variables:
-
Declare an instance or global variable of type ContextKeyword.
Also declare an unbounded array of type String to contain returned
values:12ContextKeyword icxk_baseString is_values[] -
Create the context information service by calling the
GetContextService function:1this.GetContextService("Keyword", icxk_base) -
Call the GetContextKeywords function to access the environment
variable you want. This example calls the GetContextKeywords
function to determine the current application Path:1icxk_base.GetContextKeywords("Path", is_values) -
Extract values from the returned array as necessary. When
accessing environment variables, the array should always have a
single element:1MessageBox("Path", "Path is: " + is_values[1])