Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variables 1

Status
Not open for further replies.

MoaD

Programmer
Apr 17, 2002
17
CA
Ok i have 2 asp pages

from one page i have a link like so in pagename1.asp
<A HREF=&quot;pagename2.asp?thread=<%=value%>&quot;>Link</A>

heres the problem
in pagename2.asp im using thread = Request.QueryString(&quot;thread&quot;) to get the value passed. Ive tested that the value is actually getting passed by printing it to the screen. When i try to use thread in an if statement, the conditional is not seeing the value of tread

( i.e. where both values = 1 )
If value1 = thread Then

What the heck am i doin wrong?
 
I had a weird situation like this.
Try this.

if (value1 + 0) = (thread + 0) then
 
rico14d's solution will probably work, and here's why...

When the value is got from the querystring, it will have quotes round it, and therefore will be treated as a string.... adding 0 to thread forces conversion to a number therefore making the comparison work.

Alternatives are to use the Mid expression to remove the &quot;&quot; at the beginning and end of the variable, or using cLng(thread) to convert the type to Long. I use the latter, as it's clearer what I'm doing and why (to the poor sod who comes along later to maintain the website)
 
thanks rico14d for your help and LesleyW for your explaination
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top