I think what you are tryīng to do will work. My code would be as shown below. I do not think you need casting. Try and see the results.
HSerPrint "Camping Moulin Neuf "
dim IValue as Integer
dim Var1, Var2 as Word
Var1 = 10
Var2 = 200
IValue = Var1 - Var2
HSerPrint IValue ' this prints -190
Anobium
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the Help it shows casting in the variables section, ie...
MyAverage = ([word]Value1 + Value2) / 2
Can you use "integer" as casting also for calculations that may result in a less than zero number and is it done in the same manner like...
Value = ([integer] Var1 - Var2)
and I assume you would dim the variable Value as integer?
Thanks!!!!
Title should read other THAN word...
Last edit: viscomjim 2016-08-04
Hi,
I think what you are tryīng to do will work. My code would be as shown below. I do not think you need casting. Try and see the results.
Anobium