Re: Script Recipes
Posted: Sun Mar 05, 2017 2:27 pm
If you were requesting/suggesting I simply add these two lines
that was unclear to me. I would have gladly done it, because I was only seeking to explain what I am meant by recipe when I opened the thread, and why I use self.moho in my code. In no way am I seeking to deny ways to improve things. I'll leave my previous recipe post unedited, so readers can follow your suggestions for improvement.
For readers, here's the actual call I have in my running script
I get moho from the Run method. I assign it to self, because it allows me to access moho, via self.moho, in any of the methods in msPrintSwitchLayers.lua without passing moho as a parameter. For more information about why I do that you might find these links helpful
Code: Select all
msPrintSwitchLayers.moho = moho
msPrintSwitchLayers:ProcessTopLayers()
that was unclear to me. I would have gladly done it, because I was only seeking to explain what I am meant by recipe when I opened the thread, and why I use self.moho in my code. In no way am I seeking to deny ways to improve things. I'll leave my previous recipe post unedited, so readers can follow your suggestions for improvement.
For readers, here's the actual call I have in my running script
Code: Select all
function msPrintSwitchLayers:Run(moho)
self.moho = moho
self:ProcessAllTopLayers()
end