if statement is not working

what is wrong with my code , the code inside do is not working
:foreach user in=[/ip hotspot active find user=“srm”] do={
:local ip [/ip hotspot active get $user address];
:local mac [/ip hotspot active get $user mac-address];
:local username [/ip hotspot active get $user user];

:if($ip=“11.0.0.250”) do={:log info message=“$ip”}

}

Are you sure that type of $ip is string?

I’ve tried to run this simple code with script , but no luck

:if(1=1) do={:log info message=“dddddddddd”}

Paste that line in terminal and you will see where syntax error is.

[admin@RB2011ILRM] > :if (1=1) do={:log info "dddddddddd"}        
[admin@RB2011ILRM] > :if (1=1) do={:log info message="aaaa"}

Both works.

You’re missing a space after the “if”. It’s “:if (”, not “:if(”.

it works on the terminal, but for some reason is not working in the hotspot user profile script neither the system script

yes, it was the space issue , thanks alot, isn’t there a compiler that can be used to generate the code ,something like visual studio

The easiest way to check code in scripts is to perform

/system script print

All bugs will be shown when scripts are printed to the terminal

thanks alot again