I was working through the programming book and hit a section on variants.
Originally it was showing that variants first = 123 and second = “456” became “123456” string when added together third = first + second
I was trying to apply .ToInteger and .ToString to force it to treat as integer.
Do variant data types always default to string when combined?
[Code] var first, second, third as Variant
var v as Integer
first=123
second=“456”
third = first + second.ToInteger
MessageBox(third.ToString) [/Code]
If I remove the ToString/Integer portions I get 12345, but I get errors if I add them.
Heh, and apparently a follow up question, how do I properly show code?