Difference between revisions of "Talk:ISO 7064"
From Lazarus wiki
Jump to navigationJump to searchLine 4: | Line 4: | ||
[[User:Alextp|Alextp]] ([[User talk:Alextp|talk]]) 19:32, 28 November 2021 (CET) | [[User:Alextp|Alextp]] ([[User talk:Alextp|talk]]) 19:32, 28 November 2021 (CET) | ||
:Most likely it <b>is</b> supposed to fail if any of the chars is NOT a digit. Having it fail with an exception is not worse than having it fail in some other way (e.g. setting resukt to -MaxInt, having an out paramter indicating succes or do it like the many TryStrtoYYY conversion routines we have), as long as that behaviour is documented.--[[User:Bart|Bart]] ([[User talk:Bart|talk]]) 23:39, 28 November 2021 (CET) | :Most likely it <b>is</b> supposed to fail if any of the chars is NOT a digit. Having it fail with an exception is not worse than having it fail in some other way (e.g. setting resukt to -MaxInt, having an out paramter indicating succes or do it like the many TryStrtoYYY conversion routines we have), as long as that behaviour is documented.--[[User:Bart|Bart]] ([[User talk:Bart|talk]]) 23:39, 28 November 2021 (CET) | ||
+ | ::Documented now.--[[User:Bart|Bart]] ([[User talk:Bart|talk]]) 23:42, 28 November 2021 (CET) |
Revision as of 00:42, 29 November 2021
Not stable code
Because of 'isx := StrToInt( sx );', the code fails on any non-digit string. It's bad. Alextp (talk) 19:32, 28 November 2021 (CET)
- Most likely it is supposed to fail if any of the chars is NOT a digit. Having it fail with an exception is not worse than having it fail in some other way (e.g. setting resukt to -MaxInt, having an out paramter indicating succes or do it like the many TryStrtoYYY conversion routines we have), as long as that behaviour is documented.--Bart (talk) 23:39, 28 November 2021 (CET)