Brackets are required for multiple statements... However they're not required when there will be only one statement to execute. I would personally prefer to utilize them just to keep code clean, neat and effectively helps when debugging code... I believe that excess lines though will hurt the overall runtime of EUO scripts as it executes literally line by line, so that's the draw back (If you're a stickler over fractions of milliseconds being wasted).
Example:
if #findcount = 0
{
do this one thing
}
is the same as
if #findcount = 0
do this one thing
Incorrect use would be:
if #findcount = 0
do this thing
also do this thing
and this thing
This is incorrect because everything after "do this thing" (also do this thing, and this thing) will always execute regardless of your if statement. That is where brackets are required.
This carries over into all execution regions that would exceed a single line.
Example:
In this example, either "do this" OR "do this 2" will execute while "do this 3" and "do this 4" will always execute, because EUO doesn't understand that it's an entire region specific to only the if-else statement.
if #findcount = 0
do this
else
do this 2
do this 3 ;will execute regardless of if-else statement
do this 4 ;will execute regardless of if-else statement
So you would need brackets containing the else statement's execution region.
if #findcount = 0
do this
else
{
do this 2
do this 3
do this 4
}
Vice versa:
if #findcount = 0
{
do this
do this also
}
else
do this 2
And ofcourse:
if #findcount = 0
{
do this
do this also
}
else
{
do this 2
do this 3
do this 4
}