On 24/09/2013 08:57, Bart wrote: > On 9/23/13, Martin <lazarus-ort+dvltiveelga04la...@public.gmane.org> wrote: > >> So the question is, what does or should do RomanToInt for invalid input? > > Probably return 0. > Romans seemed to have no zero at all. > It also will not break backwards compatibility, current > implementatiosn returns zero if an invalid character is found (docs > say otherwise though).
Yes, I agree that returning 0 is a good solution. The docs can be changed. > We could also leave things as they are and have a new > TryRomanToIntStrict() function added to StrUtils. As there are no issues with compatibility that would IMO only make the solution needlessly more complex. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal