Actually, that code is what I call "cheap and dirty logic". If the value data for the value name is blank, it will bite. The more bulletproof way would be to EnumValue() all the values.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.