Difference between revisions of "Talk:ISO 7064"

From Free Pascal wiki
Jump to navigationJump to search
(Created page with "=Not stable code= Because of 'isx := StrToInt( sx );', the code fails on any non-digit string. It's bad. ~~~~")
 
Line 3: Line 3:
 
Because of 'isx := StrToInt( sx );', the code fails on any non-digit string. It's bad.
 
Because of 'isx := StrToInt( sx );', the code fails on any non-digit string. It's bad.
 
[[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)

Revision as of 00:39, 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)