HELP? - How to Sum Variables with VBScript

Results 1 to 4 of 4

Thread: HELP? - How to Sum Variables with VBScript

  1. #1
    Join Date
    Dec 1969
    Posts
    552

    Default HELP? - How to Sum Variables with VBScript

    I have an ASP page that passes 5 numeric values from a form.<BR>How can I add them up to get a total?<BR><BR>If I try - <BR>TotScore = request.form("intOne")+request.form("intTwo")+...r equest.form("intN")<BR><BR>I get a concatonated value not a sum?<BR><BR>Any help would be appreciated!<BR><BR>Tim

  2. #2
    dclark Guest

    Default RE: HELP? - How to Sum Variables with VBScript

    If you&#039re bringing in values from a form on a web page, you need to convert them to a number (integer) before you can use a + operator.

  3. #3
    Kiran Shiveshwar Guest

    Default RE: HELP? - How to Sum Variables with VBScript

    Try this using cint to convert to integer.<BR><BR>TotScore = cint(request.form("intOne"))+cint(request.form("in tTwo"))+...cint(request.form("intN"))<BR>

  4. #4
    Join Date
    Dec 1969
    Posts
    552

    Default RE: HELP? - How to Sum Variables with VBScript

    Thank You!<BR><BR>It works just fine!<BR><BR>Tim


Posting Permissions

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