fpc/tests/webtbs/tw22613.pp
2012-08-16 19:22:17 +00:00

31 lines
464 B
ObjectPascal

{$inline on}
function leftstr(const s: string; l: integer): ansistring; inline;
var
i: longint;
begin
i:=1;
while i<length(s) do
begin
if s[i]=' ' then
exit(copy(s,1,i-1));
inc(i);
end;
leftstr:=s;
end;
var
Line: String;
begin
Line := 'astring2 ';
case LeftStr(Line,1) of
'astring1':
halt(1);
'astring2': // comment this line and everything works
halt(0);
else
halt(2);
end;
end.