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:
// 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:
Last updated