My recent automation components have required quite a bit of calculations compared to the automation scripts I've built up to this point. (ie Any at all really)
And I've noticed a difference in behavior between the VBscript functions Int() and CInt(). So far I have been able to use Int() with no issues. All it does is take a positive number and truncate the decimal.
This is necessary since the calculations the applications I am working with are doing just that, truncating the decimal. Weird huh?
But CInt() has an upper and lower bound. It will only allow you to convert to a integer value between -32,768 and 32,768. This becomes a problem for me because in some applications I need to be be dealing with 6 digit integer values. I tried CLng() but that rounds the value which the application under test appears not to do.
My Question to the Geekdom is, am I going to run into the same problem with Int() OR am I ok using it to truncate the numbers.
My VBScript mentor gave me an alternative solution if Int() is going to cause me grief. I've searched through my VBScript guides and on the net and no one mentions whether Int() has boundaries.
Anyone out there know if Int() has boundary conditions like CInt()?
<its never as easy as you first think it will be eh?>
posted @ Monday, July 09, 2007 9:06 PM