(And, at chance, you just have heared what's it good for
Often in a script I have the need for the same logic in different places. In "general" that's where you use a function.
*But:* often this code is connected to the calling script with a *big* bunch of variables. So functions become "un-handy" here.
My wish: a kind of "sublocal" command to call a subroutine, that works in the same environment as the caller, especially regarding variables. This regards reading, setting, and optimal also creating variables.
(In other words: as if the code were just part of the calling script. And so it's meant to be.)
As all variables are shared, there's no need for parameters or return value. (If needed it can be simulated by some vars.)
For it's physical dependency it's OK to be just callable, no need to load it. I think it's even *helpful* if the code is part of the 'master' (i.e. calling) script file!
For me this would be *very* helpful, to create less redundant, smaller, and cleaner code.
Also would reduce the needed level of indentations.
OK: who uses it is responsible for what he does
And I have the impression that it could be of use for others, too.
(I hope some say their opinion!)
And I hope it's not too hard to realize...
XYplorer Beta Club