[thelist] why doesn't this work? (ASP 2.0)

Joshua Olson joshua at waetech.com
Fri Jan 2 10:22:15 CST 2004


----- Original Message ----- 
From: "Rob Smith" <rob.smith at THERMON.com>
Sent: Friday, January 02, 2004 10:42 AM


> Hi,
>
> given calculated or retrieved values
> counter = 12
> request.querystring("Version") = 12

In this instance, counter will be of type int, and the value from the query
string is a string.

Therefore the following should work:

if CInt(trim(request.querystring("Version"))) = counter then

This code does demonstrate one problem.. it'll fail if Version is not passed
OR if it's not numeric.

I'd recommend that you use a separate block to prepare the value from the
query string.

Example:

counter = 12
version = request.querystring("version")

If NOT IsNumeric(version) then
  version = "0"
End If

version = CLng(version)

If version = counter then
  ' Do something
End If



That code should work.  If for you id does not, then there are two
possibilities

1.  ASP is messed up (it's been known to happen if there are memory issues,
installation issues, etc)
2.  You may not be detecting entry into the if...then clause correctly.

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/VA/
706.210.0168



More information about the thelist mailing list