Hi,
Anyone got a smart way around this? In https://wiki.mikrotik.com/wiki/Manual:Scripting it says
Warning: If function contains defined global variable which name matches the name of passed parameter, then globally defined variable is ignored, for compatibility with scripts written for older versions. This feature can change in future versions. Avoid using parameters with same name as global variables.
But if you have script that calls another script, and you are building the called script into more complex logic over time, that takes new paramenters, - lets call them optional parameters, then how can I check if the variable was defined, with the exception of doing exactly what this warning has told me to avoid. If I dont declare the variable in the called script, it cant work when it isn’t receiving it, and if I do, I’m breaking the rules of the warning.
Context: Think 1000s of sites, and a script with fixed variables unique to the site, calling a function. Function needs additional functionality, and neesd to be backwards compatible. All sites - even older sites that dont have the new parameter need to call updated function, and if they want to override the parameter then they must.