阿善 ·
·
阅读: 511
其实不需要重载,让Val直接支持INT64就可以了
function StrToInt(const S: string): Integer;
var
E: Integer;
begin
Val(S, Result, E);
if E <> 0 then ConvertErrorFmt(@SInvalidInteger, [S]);
end;
变成
function StrToInt(const S: string): Int64;
var
E: Int64;
begin
Val(S, Result, E);
if E <> 0 then ConvertErrorFmt(@SInvalidInteger, [S]);
end;
但不知道Val里做了什么,为什么没有这样改进。这样改反正也支持32位的