Retrieves one or more values associated with a specified keyword.
ContextKeyword objects
servicereference.GetContextKeywords ( name, values )
Argument |
Description |
---|---|
servicereference |
Reference to the ContextKeyword service instance. |
name |
String specifying the keyword for which the function returns corresponding values. |
values |
Unbounded String array into which the function places the values that correspond to name. This argument is passed by reference. |
Integer. Returns the number of elements in values if the function succeeds and -1 if an error occurs.
Call this function to access environment variables. Environment-variable availability differs by execution context:
PowerBuilder runtime The function accesses DOS environment variables, each of which has a unique keyword.
PowerBuilder window plug-in The function accesses keywords specified in the EMBED tag. These keywords need not be unique. If there is no keyword specified in the EMBED tag, the function attempts to access a DOS environment variable with the specified name.
PowerBuilder window ActiveX The function accesses DOS environment variables, each of which has a unique keyword.
This example calls the GetContextKeywords function:
String ls_keyword
Integer li_count, li_return
ContextKeyword lcx_key
li_return = this.GetContextService &
("ContextKeyword", lcx_key)
ls_keyword = sle_name.Text
lcx_key.GetContextKeywords &
(ls_keyword, is_values)
FOR li_count = 1 to UpperBound(is_values)
lb_parms.AddItem(is_values[li_count])
NEXT