I am brand new to programming and am running into some trouble with Cint overflow error. Whenever the value reaches 100,000+ I get a Cint overflow error. This was a practi
CInt
can handle betweeen -32,768 and 32,767.
Use CLng
instead of CInt
.
MSDN Reference
Converting string data to integers may be accomplished by using CInt() CLng() or CDbl().
It is important to remember the size limitations of these data types. Different programming languages have different limitations.
Here is a link to VBScript Data Types.
Integers can handle integers from -32,768 to 32,767. Long can handle integers from -2,147,483,648 to 2,147,483,647. Doubles can handle numbers up to 1.79769313486232E+308, (That's a bigger number than the number of atoms in the Sun, which is 1.19 octodecillion.) They are also double floating-point precision; meaning a double can also handle extremely precise decimal points.
grandtotal = cdbl(totalshift1) + totalshift2 + totalshift3
This will eliminate the overflow problem. It won't handle the error if a user enters a non-number, but that's another topic.