Results 1 to 3 of 3

Thread: why aint this adding right it just putting the numbers togeather

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Posts
    219

    Post

    add2 = (((i + j) + (k + l)) + ((m + n) + (o + p)))

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    123

    Post

    If you want to add two numbers I think you have to put add2 = Val(a)+ Val(b). Just an example. Or I think you can just dim your numbers as variables, not quite sure. HTH

    [This message has been edited by ravcam (edited 02-06-2000).]

  3. #3
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    You should DIM each variable as an integer, long or double depending on the type of number it can contain (look in the help for info on integers, longs and doubles)

    eg;

    Dim a as double
    dim b as double
    dim c as double

    add2=................

    If you don't DIM them VB may think they are strings and just add them together;
    eg "1"+"2"="12" when you expected 3!



    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



Posting Permissions

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



Click Here to Expand Forum to Full Width