addition of two strings

Results 1 to 3 of 3

Thread: addition of two strings

  1. #1
    Gilles Guest

    Default addition of two strings

    Please Help, I&#039m trying to add these two strings<BR>Hours = Request("Hrs") + Request("Mins")<BR>provided that "hrs" and "mins" are both input boxes names.<BR>However, the result i get is a concatenation of both values and not the addition.<BR><BR>For e.g<BR>Hrs=2<BR>Mins=30<BR>Hours=2+30=gives me 230 instead of 32<BR><BR>Please Help <BR><BR><BR><BR>

  2. #2
    Panos Barbalias Guest

    Default RE: addition of two strings

    Your problem is that with the way you are trying to get the values you are actually getting numbers with strings..And you get the result that you see...<BR>Try this:<BR>intHours = (Int(Request("Hrs"))+(Int(Request("Mins"))

  3. #3
    anamika Guest

    Default RE: addition of two strings

    covert to CINT<BR>i.e.,<BR><BR>Hours = cint(Request("Hrs")) + cint(Request("Mins"))<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts