CInt()
Posted: Fri Sep 02, 2011 1:07 pm
Don´t know how to submit a bug, so I posted here.
It would be nice to understand why does this happen (just for curiosity).
Output of the CInt() function for some arbitrary strings that commence with zero:
CInt("01") = 1
CInt("02") = 2
CInt("03") = 3
CInt("04") = 4
CInt("05") = 5
CInt("06") = 6
CInt("07") = 7
CInt("08") = 0
CInt("09") = 0
CInt("010") = 8
CInt("011") = 9
(...)
CInt("018") = 1
CInt("019") = 1
CInt("020") = 16
(...)
CInt("028") = 2
The result is the same no matter how many zeroes are ahead.
Essentially, for 0-7 ones the result is "the number - (tens * 2) " and for 8-9 ones the result is the number of tens.
It would be nice to understand why does this happen (just for curiosity).
Output of the CInt() function for some arbitrary strings that commence with zero:
CInt("01") = 1
CInt("02") = 2
CInt("03") = 3
CInt("04") = 4
CInt("05") = 5
CInt("06") = 6
CInt("07") = 7
CInt("08") = 0
CInt("09") = 0
CInt("010") = 8
CInt("011") = 9
(...)
CInt("018") = 1
CInt("019") = 1
CInt("020") = 16
(...)
CInt("028") = 2
The result is the same no matter how many zeroes are ahead.
Essentially, for 0-7 ones the result is "the number - (tens * 2) " and for 8-9 ones the result is the number of tens.