B
Bob Cottis
I am getting wierd behaviour with IsNull in ASP. I am
passing a string (which may be null) to a function. When
the string is null, IsNull seems to return false the
first time it is called, then True the second time. The
code follows, am I doing something wrong, or is this a
bug?
Bob
function unquote(st) 'make database string suitable for
output
'#################
Dim test, test2
test = IsNull(st)
test2 = IsNull(st)
if test then
unquote=st
exit function
end if
response.write("In unquote st = " & st & "; isNull(st)
=" & IsNull(st) & "; " & test & "; " & test2 & "<br>")
'if st is null, test is false, but test2 is true
st = replace(st, "&", "&")
st = replace(st, "'", "'")
st = replace(st, """, chr(34))
st = replace(st, "<br>", chr(13) & chr(10))
unquote = st
end function
passing a string (which may be null) to a function. When
the string is null, IsNull seems to return false the
first time it is called, then True the second time. The
code follows, am I doing something wrong, or is this a
bug?
Bob
function unquote(st) 'make database string suitable for
output
'#################
Dim test, test2
test = IsNull(st)
test2 = IsNull(st)
if test then
unquote=st
exit function
end if
response.write("In unquote st = " & st & "; isNull(st)
=" & IsNull(st) & "; " & test & "; " & test2 & "<br>")
'if st is null, test is false, but test2 is true
st = replace(st, "&", "&")
st = replace(st, "'", "'")
st = replace(st, """, chr(34))
st = replace(st, "<br>", chr(13) & chr(10))
unquote = st
end function