Ha, all that effort to set up "which" when all I really wanted to check was to see that a value was given.