PDA

View Full Version : [Quick Q?] 'if variable exists' equivalent for asp


mat
12-02-2002, 10:08 AM
To check if a variable exists for example, if a variable has been passed to the script or not so then it can act accordingly.

in php it would be:

if(!isset($variable)){
do this,,
}


from what i've seen so far it seems to do this in ASP one would use:

<% If variable <> "" Then %>
do this...
<% End If %>


but in my view this should not work :confused: however it has worked so far, is this actually the 'proper' way of checking if a variable exisits or not in ASP?

glenngv
12-02-2002, 11:02 AM
I think the checking depends on what data type the variable is supposed to have.
Look at this:
http://www.devguru.com/Technologies/vbscript/quickref/vartype.html