pkg_.contains(P;K)

Returns a boolean indicating whether package P contains key K (a string).

Description

pkg_.contains is a user-defined function (defined with <def_ufun/>). If you are not running your query in GUI2, pkg_.contains will only work if you import the pkg_ library: <import path="default.library.types.pkg_"/>.

Syntax

pkg_.contains(P;K)

Input

Argument Type Description
P any The name of a package variable
K any The name of a key

Return Value

If package P contains key K, pkg_.contains returns a boolean value of 1 (true). Otherwise, it returns 0.

Example

<set x="{pkg('key1' 'key2';'val1' 'val2')}"/>
<signal msg="{pkg_.contains(@x;'key1')}"/>

In the example above, the package x contains the key 'key1', so pkg_.contains returns a boolean value of 1 (true).