So, in DXE, TryStrToInt( '51,12', n ) assigns 51 to n, an integer var. Maybe I am just picky, but it seems like a bug to me.

Comments

  1. But the function result is false, isn't it?

    ReplyDelete
  2. I think its rather the point of the trystrtoxxx functions, strtoint would error - as would val (i think)

    ReplyDelete
  3. That is because internally it processes the string up to the point where it finds the non valid character (. or ,) and then returns false. The passed variable n contains the value up to that point but is not valid as the function itself returned false.
    One might expect n to not be touched unless the function can return true but that would not be optimized.

    ReplyDelete

Post a Comment