Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document new function "exists()" #909

Merged
merged 1 commit into from Oct 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions source/rainerscript/functions/rs-exists.rst
@@ -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 ...