Try the following two sentences, and everything will be clear:
E = 32767 * 10' error, because 32767 is an integer, but the operation result is a long one.
E = 32768 * 10' is not wrong, because 32768 is long and the operation result is also long.
It can't be said that this is a Bug of VB, because in fact VB is intentional! The reason is also very simple, which can save memory resources and improve the operation speed, and the effect is very obvious when performing a large number of small data operations (integer operations with operation results less than 32768).
To avoid this error, you can force a number involved in the operation to be a long number (only one number is needed), for example:
e = 4000 & amp* 10
e = 4000 * 10 & amp;
e = CLng(4000) * 10
Well, after the lecture, let's assign homework and say the following four sentences, which one will go wrong without computer testing:
e = 32767 + 10
e = 32767 - 10
e = 32767 * 10
e = 32767 / 10