Community discussions

MikroTik App
 
Pumpir
newbie
Topic Author
Posts: 49
Joined: Wed Jan 11, 2006 2:17 pm

Script errors view

Mon Nov 27, 2006 11:02 pm

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
 
User avatar
mneumark
Member
Member
Posts: 375
Joined: Thu Jun 08, 2006 7:20 am
Location: Escalon, CA
Contact:

Wed Nov 29, 2006 9:23 am

Have you ran your script and looked in the log to see what it says?
 
Pumpir
newbie
Topic Author
Posts: 49
Joined: Wed Jan 11, 2006 2:17 pm

Nothing in log file

Wed Nov 29, 2006 10:41 pm

Sure, I have log window opened to see it permanently, there is nothing.
 
User avatar
mneumark
Member
Member
Posts: 375
Joined: Thu Jun 08, 2006 7:20 am
Location: Escalon, CA
Contact:

Thu Nov 30, 2006 7:27 am

Can you post your script so we can look at it?
 
changeip
Forum Guru
Forum Guru
Posts: 3824
Joined: Fri May 28, 2004 5:22 pm

Thu Nov 30, 2006 8:03 pm

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
 
Pumpir
newbie
Topic Author
Posts: 49
Joined: Wed Jan 11, 2006 2:17 pm

Sun Dec 03, 2006 5:49 pm

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.
 
User avatar
Giepie
Member
Member
Posts: 432
Joined: Mon Sep 13, 2004 12:33 pm
Location: Western Cape, South Africa
Contact:

Re: Script errors view

Sat Jun 21, 2008 2:42 am

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
The only thing Mikrotik lack, is to send power to your High Sites wirelessly.....
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6176
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Script errors view

Wed Jun 25, 2008 1:31 pm

It would be very cool if MT Scripting could change the colours of certain elements like in C++ or even MT3.x CLI.
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.
 
deweydb
just joined
Posts: 7
Joined: Mon Dec 14, 2020 10:03 pm

Re: Script errors view

Wed Dec 23, 2020 2:59 am

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.
 
voskamikfor
just joined
Posts: 1
Joined: Sun Apr 28, 2019 11:21 am

Re: Script errors view

Thu Jan 14, 2021 9:18 am

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
Image Image

Who is online

Users browsing this forum: Google [Bot] and 31 guests