Script errors view

I am a beginner with scripting in MT, when I am testing some scripts, I have no idea, where to find more information about script result. I have some mistake inside, but when I run a script, Run Count is still 0 and I have no information, where to look for the problem.
Ivan

Have you ran your script and looked in the log to see what it says?

Sure, I have log window opened to see it permanently, there is nothing.

Can you post your script so we can look at it?

I really hope 3.x has better scripting support. There is absolutely no error output or debugging. You can try putting :log info “line X running” in the script before each command and see where it stops - but sometimes if there is another problem the script won’t even run at all.

Sam

Finally I found syntax error, but the problem is, that it takes very long time to debug any script when there is no error output.

I agree

It is hard to find bugs in a script with no error output.

I usually hash out newly added portions of my scripts and remove the hashes after everytime the script ran propperly. Once I hashed out something and the script won’t run, I have a rough idea for where to look.

It would be very cool if MT Scripting could change the colours of certain elements like in C++ or even MT3.x CLI.

G

Variables, commands, etc. are in different colors in version 3.x, it is very easy to read script with those colors enabled and find any syntax errors.

When you so /system script print, if script has syntax error it is highlighted in red, so it is very easy to find syntax errors, too.

It would still be very useful to see the syntax error print in the log when the script runs (fails), perhaps with a line number as a bonus.

I suggested the following improvements for Mikrotik. They wrote that if there were more demands, they would solve it. So please write to them.

In Winbox script: This would be perfect for anyone who writes scripts. When an error is reported in the terminal window, one has to count where the error row is. Thanks