The manual for scripting, under Variables (https://wiki.mikrotik.com/wiki/Manual:Scripting#Variables), says the following:
Note: Variable value size is limited to 4096bytes
Does that apply somehow to arrays?
:global v [/interface print as-value]
:global s [:tostr $v]
138
:put [:len $s]
11767
The above three commands were run on RouterOS version 6.36.4.
They show variable $s with more bytes than the documentation says is the limit.
Did I misunderstand the manual?
I tried to add this to the Wiki Discussion page, but I don’t have permission to edit.
User janisk, in the message at http://forum.mikrotik.com/t/save-export-to-variable/36882/3 says that there was never any limit on variable size, but only on files:
always variables could hold more data than 4KB. Only limitation is how much you can write/read to file.
User rextended has this warning in the message at http://forum.mikrotik.com/t/ap-station-mode/2891/1
On RouterOS the maxmimum length of a String variable are 4096 Byte
…
any Array have maximum size of “the sum of lenght of all single elements on Array” + “number of Array elements” <= 4096 Byte!!!
Could someone please clarify?
I’m currently using a global variable that’s larger than 4096 bytes, and I want to make sure that future versions of RouterOS are not going to break that.