How to turn a function off and on

This reminds me of that old discussion from three years ago.