Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

URGENT: How do you make an asp request object into a number in vbscript?

Posted on 1999-06-24
6
Medium Priority
?
163 Views
Last Modified: 2013-12-25
Why do I get a "type mismatch" error on this script?
what's the right way to do it?
YTotal = Int(request("YTotal"))

Thanks,
Dena
0
Comment
Question by:denam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:TTom
ID: 1863509
Hi Dena!

If it's vbscript and you are trying to change a string to an integer value, I think the right syntax is:

YTotal = cInt(request("YTotal"))

int returns the integer portion of a number, e.g. int(5.5) = 5

cInt("5.5") = 5.5

HTH,

Tom
0
 

Expert Comment

by:expertKD
ID: 1863510
Hi Dena,

At the beginning of that particular asp file give
<%@ Language=VBScript %>
then in the next line
<% YTotal = CInt(Request("YTotal"))%>
  I thick this will solve your problem
0
 
LVL 9

Expert Comment

by:TTom
ID: 1863511
Sounds a lot like what I said, no?

Tom (:-{
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:denam
ID: 1863512
i did include the vbscript language tag in my file.  the code i showed
you was just the one line of code not the entire file.  before asking the
question i had tried both int and cint (should have told you that Tom :).
I did find the solution last night.  the problem was that the YTotal was
NULL.  Tom's answer was still correct and if you'd like the points Tom,
please submit your comment as an answer.  And thanks again to
all who responded to my question.

Dena
0
 
LVL 9

Accepted Solution

by:
TTom earned 300 total points
ID: 1863513
Dena:

Happy to get points, but, if you would prefer, have Customer Service kill the question and take the points back.  I will not be offended.  I will get them some other time. <G>

Tom
0
 
LVL 1

Author Comment

by:denam
ID: 1863514
Tom, I'm happy to give you the points.  I appreciate all your good help.

Dena
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question