Sanny Builder
Search…
In English
Troubleshooting
Powered By GitBook
0071: Incorrect number of conditions
A conditional statement 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:
1
// before
2
if and
12
[email protected] == 1 // error, too many conditions
13
[email protected] == 1 // error, too many conditions
14
then
15
// then code
16
else
17
// else code
18
end
19
20
// after
21
if
22
gosub @check
23
then
24
// then code
25
else
26
// else code
27
end
28
29
:check
30
if and
40
then
41
if and
44
then
45
return
46
end
47
end
48
return
49
50
Copied!
OR:
1
// before
2
if or
12
[email protected] == 10 // error, too many conditions
13
[email protected] == 11 // error, too many conditions
14
then
15
// then code
16
else
17
// else code
18
end
19
20
21
// after
22
if
23
gosub @check
24
then
25
// then code
26
else
27
// else code
28
end
29
30
:check
31
if or
41
then
42
return
43
end
44
if or
47
then
48
return
49
end
50
return
Copied!
Last modified 1yr ago
Copy link