2

I am working with some classic asp for a project. I have run some syntax that I am unfamiliar with multiple times.

Here is an example:

if Request.QueryString("viewpopup") <> "" then
        queryString = "?viewpopup=" & Request.QueryString("viewpopup")
    end if

What I am attempting to identify is what the <> and the "" does in the first line of this statement.

0m3r
  • 12,286
  • 15
  • 35
  • 71
normandantzig
  • 169
  • 2
  • 8
  • possible duplicate of [What is the '<>' asp operator?](http://stackoverflow.com/questions/30922176/what-is-the-asp-operator) – Dijkgraaf Jun 23 '15 at 01:08
  • @Dijkgraaf not really, since this one here also asks about the empty string, and about a whole code snippet as a whole – Shadow The GPT Wizard Jun 23 '15 at 13:32
  • @ShadowWizard That question doesn't talk about empty strings is true, however the answers do discuss the empty string. Hence I think it still is a good fit for a duplicate. – Dijkgraaf Jun 23 '15 at 20:41

2 Answers2

5

In classic asp <> is the "not equal to" operator.

"" is an empty string.

So basically it is checking to see if the incoming query string contains an item viewpopup that has a value, and if so set a variable called queryString to have that same variable and value.

Martha
  • 3,932
  • 3
  • 33
  • 42
Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
1

It's hard to know what the original intent was. But my guess would be that the writer wanted to test to see if that particular parameter (viewpopup) was provided in the query string. The equivalent could have been:

If Not (Request.QueryString("viewpopup") Is Nothing) Then ....
Olivier De Meulder
  • 2,493
  • 3
  • 25
  • 30
  • 1
    There's nothing hard to understand about the code snippet. Also, `Is Nothing` is a completely different condition than `<> ""`. – Martha Jun 23 '15 at 01:32