Apologies for the “idiod” question; I saw many scripts with [ /function ] with and without the spaces between [brackets], always used without but all the scripts from MikroTik are with a space in between.
There are cases where space is necessary and other where is not? (Except RegEx)
Thanks
The question is wrong, there is no common rule for everything.
If, on the other hand, you are only talking about code to be executed between , it doesn’t matter if you put them there or not.
If you look at my scripts (except in cases that I need to layout the code so it can be read better) I never use them.
[:osfunction parameter]
[/call this function]
[contextfunction parameter]
[$userdefinedfunction parameter]
On other places, you never must put spaces, like on
literally "-1"
do={
else={
etc.
Right now I can’t come up with examples of where it necessarily takes space (ignoring RegEx)
Just
3 + -2 ; # (for obtain 1)
not
3+-2 ; # (for obtain 1)
# it work but readabiliy...
# tis do not work at all, give -1 instad of -3
3/ -1
Was hoping for an answer from you!
The question was easier than you thought, examples:
- /interface ethernet set [ find default-name=ether5 ] VS. /interface ethernet set [find default-name=ether5]
- $[ /system routerboard get model ] VS. $[/system routerboard get model]
- [ :resolve google.com ] VS. [:resolve google.com]
(just few examples pasted from a random search online)
THANKS!
[GRAZIE!]
I hope you’ve understood that, apart from when it’s necessarily needed, or when it’s to be avoided by force, then it’s tastes.
I like it without spaces, but sometimes to improve readability, in specific cases, I put them there.
It depends on your taste and how best you read the code.