Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 15133

Scripting • Re: `conditional not boolean` bug with :onerror (new in 7.13)

$
0
0
I don't think it's can be a simple as an implied requirement to return something.
Perhaps not. To be clear, I was NOT saying it should be a "requirement" ;)

FWIW, code blocks already have an implict return of the last value of cmd in block, so why I thought that was involved (like that a :set returns nil, but :put returns a string) e.g.
Code:
:global x [:do {:put "a"; :put "b"; :put "c"}]:put "tostr: $[:tostr $x] len: $[:len $x] typeof: $[:typeof $x] array0: $($x->0) array1: $($x->1)"tostr: ;c len: 2 typeof: array array0:  array1: c
As shown the "c" is returned in an 2 element array, even without a return. Why it's an array, or perhaps anything at all - mysteries of RouterOS script. But it's not a "nil" return, which seems to be involved in the bug here.

Statistics: Posted by Amm0 — Sat Jan 27, 2024 7:08 pm



Viewing all articles
Browse latest Browse all 15133

Trending Articles