Documentation: Add dependency example for setting locally scoped variables

fixes #7319