:put used to debug print

Hi,

I have started to write some script under RouterOS 3 Beta 7 and I am using :put to print some debug infos to console. Now I tried to run the script under 2.9.41 and the :put doesn’t display anything on the screen (when used from a script). And the script seems to not run at all but no info/hint/error is reported by routerOS. Is it normal under 2.9.x? The 3.0 does show problems with script when ‘run x’ is invoked…

thanks

In 2.9 you can use the :log info (blah) command to print debug info to the log. That works better for me in 2.9.

Hi,

I know I can use :log command (I am using it for reporting). But I was used from 3 beta that :put works. In the 2.9.x it seems that the :put works only when used in sequence of command started manually from command line…

thanks

Scripts do not have ‘screens’ open, so you won’t see it. It in certain cases will lock up the script since it cannot output. Always use :log and possibly create your own topic, or use ‘script’ or ‘debug’.

Run needs a script name also. Running by number doesn’t always work.

you should wrote: there is no ‘screen’ for scripts under 2.9.x. The 3.0 Beta7 scripts are able to put text on the terminal. The scripts started from scheduler are different case (there really is no screen). And i didn’t intend to use :put in final version of the script.

I had no troubles using ‘run 1’ when debugging the scripts. Of course I had to use ‘print’ at first and to check what number is assigned to the script.
I didn’t know I can use the name :slight_smile: Help shows that the run command expects number…

:put will output info to current session. this is available only in v3.0
And you can easily run scripts by names (by names is more preferable)