* val takes care of empty string, patch from Petr Kristan

git-svn-id: trunk@10609 -
This commit is contained in:
florian 2008-04-06 19:33:31 +00:00
parent 95aaa7a74b
commit 347ae5a3bf

View File

@ -765,12 +765,18 @@ Function InitVal(const s:shortstring;out negativ:boolean;out base:byte):ValSInt;
var
Code : SizeInt;
begin
{Skip Spaces and Tab}
code:=1;
negativ:=false;
base:=10;
if length(s)=0 then
begin
InitVal:=code;
Exit;
end;
{Skip Spaces and Tab}
while (code<=length(s)) and (s[code] in [' ',#9]) do
inc(code);
{Sign}
negativ:=false;
case s[code] of
'-' : begin
negativ:=true;
@ -779,7 +785,6 @@ begin
'+' : inc(code);
end;
{Base}
base:=10;
if code<=length(s) then
begin
case s[code] of
@ -1388,3 +1393,4 @@ begin
ShortCompareText := L1 - L2;
end;