* runtime check

This commit is contained in:
peter 2002-12-24 16:52:29 +00:00
parent af98b48c22
commit 3e86b4d56e

View File

@ -1,13 +1,33 @@
{ %version=1.1 } {$ifdef fpc}{$mode objfpc}{$endif}
{$mode objfpc}
procedure p(a : array of const);
procedure p(a : array of const);
var
i : integer;
begin begin
for i:=low(a) to high(a) do
begin
write(i,': ');
if (a[i].vtype=vtpchar) then
begin
writeln('"',a[i].vpchar,'"');
if (a[i].vpchar<>'test') then
begin
writeln('Wrong string content');
halt(1);
end;
end
else
begin
writeln('No string type (',a[i].vtype,')');
halt(1);
end;
end;
end; end;
var var
a : array[0..25] of char; a : array[0..25] of char;
begin begin
p([a]); a:='test';
p([a,a]);
end. end.