summaryrefslogtreecommitdiffstats
path: root/doc/antora/modules/unlang/pages/condition/or.adoc
blob: 80c2cb45a82977dd8bb5a7d8eeaac04872a0e179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
= The || Operator

.Syntax
[source,unlang]
----
(expression-1 || expression-2)
----

The `||` operator performs a short-circuit "or" evaluation of the two
expressions. This operator evaluates _condition-1_ and returns `true`
if _condition-1_ returns true. Only if _condition-1_ returns `false`
is _condition-2_ evaluated and its result returned.

.Examples
[source,unlang]
----
if (&User-Name || &NAS-IP-Address) { ...
----

// Copyright (C) 2020 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
// Development of this documentation was sponsored by Network RADIUS SAS.