simple if statement issue

Hi, I am trying to use simple comparison:

set nullindex 1

if{($nullindex>-1)}{ log local1. “test” }

This what I see in a log: invalid command name “if{(1>-1)}{” while executing “if{($nullindex>-1)}{”

Please, help

set nullindex 1
if { $nullindex > -1 } {
    log local1. "test"
}

or if you insist on using parenthesis:

set nullindex 1
if { ($nullindex > -1) } {
    log local1. "test"
}

The issue is it tries to evaluate command

if{(1>-1)}{

instead of

if

because there is no space after

if

And there is also a missing space after the closing curly bracket!