Code: Select all

`if any_integer = 4 or any_integer = 5 or key_left = true or key_right = true then`

Will not compile:

*Suspicious logic operation, mixed boolean and non-boolean*

What is the best solution here? A one-liner would be good.

Code: Select all

`if any_integer = 4 or any_integer = 5 or key_left = true or key_right = true then`

Will not compile:

What is the best solution here? A one-liner would be good.

That compiles but with warnings.

Otherwise, for example:

`if Cbool(any_integer = 4 or any_integer = 5) or key_left = true or key_right = true then`

Otherwise, for example:

N3trunn3r wrote:What is the best solution here?

More efficient (using boolean short-cut operators:

Users browsing this forum: No registered users and 6 guests