Vote UpVote

In `System.SysUtils`, `class function TCardinalHelper.Parse` throws errors for valid Cardinal values

The Wiert Corner – Oh nice System.SysUtils.TCardinalHelper.Parse: class function TCardinalHelper.Parse(const S: string): Cardinal; begin Result := StrToInt(S); end; Which means you get this nice EConvertError with message ''4294967295' is not a valid integer value'. with this simple test (which doesn’t even reach the Assert): uses System.SysUtils; procedure Cardinal_Parse_High_Cardinal_Succeeds(); var Expected: Cardinal; Value: string; Actual: Cardinal; begin Expected := High(Cardinal); Value := Expected.ToString(); Actual := Cardinal.Parse(Value); Assert(Expected = Actual); end; So ...
Favorite? Off-Topic? jpluimers @ 2016-10-05 16:00


Visits: 1438
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)