normandantzig
normandantzig

Reputation: 169

Asp conditional syntax

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.

Upvotes: 2

Views: 245

Answers (2)

Dijkgraaf
Dijkgraaf

Reputation: 11527

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.

Upvotes: 5

Olivier De Meulder
Olivier De Meulder

Reputation: 2501

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 ....

Upvotes: 1

Related Questions