Currently I have used the code provided by jdporter instead of my switch statement. However, I will now look at the dispatch table option that you have recommended and see if that will make this script easier to maintain.
Thanks for your reply
in reply to Re^2: Coding for maintainability
in thread Coding for maintainability