EnTerr
9 years agoRoku Guru
strtoi() = invalid?
i tried using StrToI and noticed it does not behave as advertised:
I can see the intent was to return invalid if the string does not parse well, since the return type is Dynamic and not Integer. But nowadays it returns 0 instead, doc and behavior are out-of-sync.
Also, when speaking of conversion string -> int, what are the differences between strtoi(str), string.toint() and val(str, 10)?
StrToI(str as String) as Dynamic
Return the integer value of the string, or invalid if str is not a string.
I can see the intent was to return invalid if the string does not parse well, since the return type is Dynamic and not Integer. But nowadays it returns 0 instead, doc and behavior are out-of-sync.
Also, when speaking of conversion string -> int, what are the differences between strtoi(str), string.toint() and val(str, 10)?