Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #909 from rgerhards/i905
document new function "exists()"
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
******** | ||
exists() | ||
******** | ||
|
||
Purpose | ||
======= | ||
|
||
exists($!path!varname) | ||
|
||
This function checks if the specified variable exists, in other | ||
words: contains a value. A variable that once was set and later | ||
on unset does also not exist. | ||
|
||
The function accepts a single argument, which needs to be a variable. | ||
It returns 0 if the variable does not exist and 1 otherwise. The | ||
function can be combined with any other expression to form more | ||
complec expressions. | ||
|
||
.. versionadded:: 8.2010.10 | ||
|
||
|
||
Example | ||
======= | ||
|
||
.. code-block:: none | ||
if exists(!$path!varname) then ... | ||
if not exists($.local!var) then ... | ||
if exists($!triggervar) and $msg contains "something" then ... | ||