i.e dim a , b,c
a=40,b=30
c=a+b
result=4030
while desire result should be 70
|
Go4Expert Member
|
|
| 19Jun2007,09:26 | #1 |
|
when i use + operator in vbscript it not add two variable it works like string formate
i.e dim a , b,c a=40,b=30 c=a+b result=4030 while desire result should be 70
|
|
Go4Expert Founder
|
![]() |
| 19Jun2007,10:51 | #2 |
|
You define a,b and c as integers specifically.
|
|
Go4Expert Member
|
|
| 23Jun2007,07:39 | #3 |
|
could you please send me the code sinnept because i tried your idea but it doesn't work
|
|
Team Leader
|
![]() |
| 23Jun2007,10:06 | #4 |
|
I guess it's JavaScript and not VBScript, in VBScript the concatenation operator is &
If it's JavaScript, here's the solution! Code: JavaScript
And similar code for VBScript Code: VBScript
|
|
Go4Expert Member
|
|
| 24Jun2007,13:04 | #5 |
|
thanks for your response .
|
|
Go4Expert Member
|
|
| 7Jul2007,14:28 | #6 |
|
HTML Code:
dim a , b,c a=40,b=30 c=a+b result=4030 while desire result should be 70 ... because The Host should interpret your variables to be variant... it means that base from your code the result should be 70... But it seems to me that theres just something wrong in your code... please refer to line number 2 of your code... You cant do a comma when assigning values... try this one instead... ------------------ dim a , b,c a=40 b=30 c=a+b msgbox c, "Result is" -------------------- |