# or

&#x20;X3 programming language, the keyword "or" serves as a logical operator. Let's delve deeper into its functionality and usage:

#### Functionality:

The "or" keyword is used to combine two logical conditions. It evaluates to true if at least one of the conditions is true. If both conditions are false, the overall expression evaluates to false.

#### Usage:

```x3
var x = 5
var y = 10

# Using 'or' in an 'if' statement
if x > 0 or y < 5 then
    show("At least one condition is true.")
end
```

#### Explanation:

* In this example, the "if" statement checks if either `x` is greater than 0 or `y` is less than 5.
* If either of these conditions is true, the statement inside the "if" block will be executed.

#### Example:

```x3
var isWeekend = false
var isHoliday = true

# Using 'or' in a compound condition
if isWeekend or isHoliday then
    show("It's a weekend or a holiday!")
end
```

#### Explanation:

* Here, the "if" statement checks if `isWeekend` is true or `isHoliday` is true.
* If either variable is true (or both), the statement inside the "if" block will be executed.

#### Short-circuit Evaluation:

In many programming languages, including X3, "or" follows short-circuit evaluation. If the first condition is true, the second condition won't be evaluated because the overall expression will already be true.

#### Example:

```x3
var x = 5
var y = 10

if x > 0 or y / x > 3 then
    show("At least one condition is true.")
end
```

#### Explanation:

* In this example, if `x` is greater than 0, the expression will be true without needing to evaluate `y / x > 3`. Thus, the division operation won't occur if `x > 0` is true.

By incorporating the "or" keyword as a logical operator in your X3 language, you provide users with the ability to express compound conditions in their programs, allowing for more flexible control flow.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manis-organization-2.gitbook.io/untitled-1/keywords/operators-in-x3/or.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
