Subroutine Parameters Documentation Recommendation

I've been playing around with new Subroutines and I'm loving them.

I think the documentation for Subroutines could be improved to explicitly convey how the parameter variables are scoped.

I discovered that the parameters defined in the Subroutine Trigger are globally scoped. I was little surprised by this, but then I realized that the parameters follow the same naming and scoping rules as normal variables.

I was able to prefix my parameters with "local__" to properly encapsulate them within the scope of the subroutine. And, when execute the subroutine, the "local__" prefixes are not displayed in the configuration UI. Very nice.

1 Like

@peternlewis – Please Note.

Yes, there is nothing special about the parameter variables, so they are scoped in the same way as they normally are.

Thank you. Understood. My developer brain saw "subroutine" and assumed (you know what happens when you assume!?) that the parameters had local scope.

1 Like