Print Page | Close Window

help with sum of values

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2428
Printed Date: 29 March 2026 at 10:15am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: help with sum of values
Posted By: Mattblack
Subject: help with sum of values
Date Posted: 05 May 2003 at 5:39am

please help guys.  Im trying to get the sum of 2 values to be displayed.  Here is an example....

<%
Dim intVar
intVar = request.querystring("number")
%>

<P><%= intVar %> + <%= intVar %> = <%= intVar + intVar %></P>

I want this to display on the page as (Taking number as "4")...
4+4 = 8

Instead i get 4+4 = 44

If i change the script replacing request.querystring("number")
 with the actual number then it works, but i need it to be called from the form or querystring.  Please help!  How do i get around this problem?  Im tearing my hair out.


Cheers peeps




Replies:
Posted By: TYSON
Date Posted: 05 May 2003 at 7:37am

Try This
<%
Dim intVar
intVar = Cint(request.querystring("number"))

%>

<P><%= intVar %> + <%= intVar %> = <%= intVar + intVar %></P>



-------------
http://www.fuo-motorsports.com/ - http://www.fuo-motorsports.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net