fpc/tests/webtbs/tw22936.pp
florian 761fcca4ec + is_dynamicstring
+ implement low/high for dynamic strings, resolves #15244 and #22936
+ basic support for $zerobasedstrings directive

git-svn-id: trunk@22933 -
2012-11-04 21:48:53 +00:00

32 lines
335 B
ObjectPascal

program Project1;
var
s: ansistring;
i : integer;
begin
s := 'abc';
i:=1;
if low(s)<>i then
halt(1);
if high(s)<>3 then
halt(1);
i:=0;
{$ZEROBASEDSTRINGS ON}
if low(s)<>i then
halt(1);
if high(s)<>2 then
halt(1);
if s[0]<>'a' then
halt(1);
{$ZEROBASEDSTRINGS OFF}
writeln('ok');
end.