I'm trying to clean up code by stripping parameters from a function within a private scope, like this:
Function complicatedFunction(x as Double, param1 as Double, param2 as Double)
...
End Function
Function mainActionHappensHere(L as Double, U as Double ...)
Function cleaner(x)
cleaner = complicatedFunction(x, L, U)
End Function
...
cleaner(x) 'Many calls to this function
...
End Function
Is this possible? Compiler complains, "Expected End Function", since I'm beginning a function before ending the outer one. And Google is no help :( PS I can't define cleaner() outside of mainActionHappensHere(), since then the correct L and U won't get passed into it.
mySub x, y, z
compared to callingmySub x
that nevertheless functionally impliesmySub x, y, z
in implementation is hardly 'cleaning' anything in my opinion. – Tambourine