Type mismatch

Thread Solved

Join Date: Jul 2005
Posts: 35
Reputation: k_en is an unknown quantity at this point 
Solved Threads: 0
k_en k_en is offline Offline
Light Poster

Type mismatch

 
0
  #1
Mar 27th, 2007
dim num, GOPercent

num = Request.Cookies("Result")

GOPercent = num/25 Type mismatch: '[string: ""]'

Error Type mismatch. But the value i put in Response.cookies("Result") is a CInt(value)

how to solve this ?????
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 114
Reputation: davidcairns is an unknown quantity at this point 
Solved Threads: 8
davidcairns davidcairns is offline Offline
Junior Poster

Re: Type mismatch

 
0
  #2
Mar 27th, 2007
I'm not sure if you're saying the value you get from num = Request.Cookies("Result") is blank or just that it is a mismatch.

First of all do the following to your code



num = Request.Cookies("Result")

If num <> "" Then

GOPercent = cInt(num)/25

End If



If you are saying you get no value back then check two things

1. You are definately setting Response("Result") to a value

2. Cookies are enabled on the client browser

You are going to need a lot more durable code to run this kind of thing so look in to how to preempt errors and handle issues. This isn't as easy in vbscript as it is in other languages, but there's always a way
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 35
Reputation: k_en is an unknown quantity at this point 
Solved Threads: 0
k_en k_en is offline Offline
Light Poster

Re: Type mismatch

 
0
  #3
Mar 27th, 2007
Thanks.....Solve
Last edited by k_en; Mar 27th, 2007 at 8:00 am.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC