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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Values! - keeps concatenating #$#@!

Status
Not open for further replies.

kramerica

Technical User
Jun 19, 2001
74
US
How do you add the 2 string values?

I have 2 variables that I am reading from a Recordset.


A= RSRECORDS("TotalB")
B= rsRecords("TotalC")

RESPONSE.WRITE (a) + (B)

if Value for a = 763 and value for B = 381 my response.write statement keeps giving me 763381
What am I doing wrong?

 
RESPONSE.WRITE cInt(a) + cInt(B)
Get the Best Answers! faq333-2924
"A witty saying proves nothing." - Voltaire
mikewolf@tst-us.com
 

My ASP code returned an error when I used Cint..

I ended up using INT(A) + INT(b). Thanks for pointing me in the right direction.

kramerica
 
Are you using vbScript?

cInt() should work unless you are dealing with numbers larger than 32,767 (where you would use cLng()) Get the Best Answers! faq333-2924
"A witty saying proves nothing." - Voltaire
mikewolf@tst-us.com
 
that probably means your using javascript then right? ---------------------------------------
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee");alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
whoops to fast today mwolf ---------------------------------------
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee");alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top