Results 1 to 2 of 2

Thread: counting?

  1. #1
    Join Date
    Dec 1969

    Default counting?

    sample code here<BR>&#039;form one has the value 1,form b has value 2<BR>blah = request.form("one")<BR>blah1 = request.form("two")<BR><BR>then i wanna count them up<BR><BR>count = blah + blah1<BR><BR>response.write count<BR><BR>it is giving me 12<BR><BR>just putting them do i get it to count them..thanks<BR>

  2. #2
    Join Date
    Dec 1969

    Default *ALL* values from Request(xxx)...

    ...are *always* strings.<BR><BR>So you are *concatenating* the two string when you do<BR> count = blah + blah1<BR>just as if you had done<BR> count = "1" + "2"<BR><BR>You need to convert the strings to numbers. (Of course, you should first probably check to be sure they *are* numbers.)<BR><BR> count = CDbl(blah) + CDbl(blah1)<BR><BR>For example.<BR><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