Strange error

Hi there,

I’m using this code inside a script:

{
local wlan [len [interface wireless find]]
if ($wlan<1) do={/system package disable wireless}
}

Inside the script, it return “syntax error” on the first character of “wlan”.

If I run this code OUTSIDE the main script, it returns no error and it works.
Inside the main script returns the error.

What could be the cause of the error?

Post the entire script. There could be an error on the line before causing it to show an error on this line instead.