# 0071: Incorrect number of conditions

A [conditional statement](/language/control-flow/conditions.md) exceeds the number of conditions allowed per one statement. The maximum number of conditions combined with the `AND` or `OR` operation is `9`.

**Possible solutions:** split the conditional statement so that no statement has more than 9 conditions.

Transforming conditional statements while preserving the logical relation between conditions can be achieved by extracting the conditions into a separate subroutine as demonstrated below.

`AND`:

```
// before
if and
  0@ == 1
  1@ == 1
  2@ == 1
  3@ == 1
  4@ == 1
  5@ == 1
  6@ == 1
  7@ == 1
  8@ == 1
  9@ == 1 // error, too many conditions
  10@ == 1 // error, too many conditions
then
  // then code
else
  // else code
end

// after
if
  gosub @check
then
  // then code
else
  // else code
end

:check
if and
  0@ == 1
  1@ == 1
  2@ == 1
  3@ == 1
  4@ == 1
  5@ == 1
  6@ == 1
  7@ == 1
  8@ == 1
then
  if and
    9@ == 1
    10@ == 1
  then
    return
  end
end
return


```

`OR`:

```
// before
if or
  0@ == 1
  0@ == 2
  0@ == 3
  0@ == 4
  0@ == 5
  0@ == 6
  0@ == 7
  0@ == 8
  0@ == 9
  0@ == 10 // error, too many conditions
  0@ == 11 // error, too many conditions
then
  // then code
else
  // else code
end


// after
if 
  gosub @check
then
  // then code
else
  // else code
end

:check
if or
  0@ == 1
  0@ == 2
  0@ == 3
  0@ == 4
  0@ == 5
  0@ == 6
  0@ == 7
  0@ == 8
  0@ == 9
then
  return
end
if or
  0@ == 10
  0@ == 11
then
  return
end
return
```


---

# 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://docs.sannybuilder.com/troubleshooting/errors/0071.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.
