In PHP, there’s a fancy little function called “isset()” that allows you to test whether a variable has been set (as opposed to being instantiated or declared).  Classic ASP doesn’t, and I have to relearn how to do it every time.  I code ASP JavaScript, so here’s what I found:

var q = Request.QueryString('query') + '';

if (q == 'undefined') then { doSomething(q); }

The idea is to convert the contents of the “query” parameter to a String (hence concatenating the '' to the end of the variable, which I prefer over the String() constructor or .toString() function), then test it against the string ‘undefined’.  If the query string did not contain a “query” parameter, then my “q” variable will be undefined. However testing for the “undefined” value in JavaScript is bad, so I convert it to a string.  Sketchy, I know, but it works for me.