adding problem

Results 1 to 2 of 2

Thread: adding problem

  1. #1
    shan Guest

    Default adding problem

    Hi all,<BR><BR>i want to add to variable like this <BR>sTr_a = 3<BR>sTr_b = 7<BR><BR>when i add this then not giving result<BR>sTr_add = sTr_a + sTr_b <BR><BR>then result become<BR>37<BR><BR>it means both string become concenate each other<BR><BR>please do help me<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: adding problem

    The reason the addition is being treated as a string is because the values of sTr_a and sTr_b are strings and not numbers. Check that in your code you have not got apostrophes around the values, i.e. this will not work:<BR>sTr_a=&#039 3&#039 sTr_b=&#039 4&#039<BR>because it treats the values as strings when you add apostrophes

Posting Permissions

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