Vb Basic Addition Concatenation Instead Of Addition Follow

0
Avatar
Legacy Poster

Hi

 

My VB skills are very rudimentary......................

 

I've created some "named sources" and want to add then together

 

[attachment=1156:Script Assistant (Multi-Line Script)_2014-08-27_07-50-52.png]

 

[attachment=1157:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_07-54-03.png]

 

[attachment=1158:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_07-54-54.png]

 

But M1 and M2 are concatenated (4+25 = 425)

 

[attachment=1159:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_07-57-23.png]

 

But if I change the formula to "Value = 0 + M1 + M2" It works?

 

[attachment=1159:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_07-57-23.png]

 

[attachment=1160:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_08-00-30.png]

 

Thoughts?

2 comments

0
Avatar
Michael Toupin (mtoupin
Comment actions Permalink

you have to convert them to integers first. Your DIM statements aren't working because the objects already exist. Try value = cInt(M1) + cInt(M2) instead. Or even better value = cint(Format.NamedSubStrings("M1").Value) + cint(Format.NamedSubStrings("M2").Value)
0
Avatar
Legacy Poster
Comment actions Permalink

Thanks

 

That worked (first option) didn't try the second one

Please sign in to leave a comment.