Need help understanding the "switch" function

You should re-edit your posting so your code apears as a code-section