* runtime check

This commit is contained in:
peter 2003-01-03 19:18:14 +00:00
parent 73a08fc4a6
commit 133a9aa958

View File

@ -7,10 +7,11 @@ Const LONG_STR_SIZE=4096;
Type tLongStr=Object // try to change this
// to Record
LStr:Array[1..LONG_STR_SIZE] Of Char;
LStr:Array[0..LONG_STR_SIZE] Of Char;
LLength:Longint;
End;
Operator := (S:String) R:tLongStr;
Begin
R.LLength:=Length(S);
@ -21,4 +22,12 @@ Var T:tLongStr;
Begin
T:='Hello';
if (T.LLength<>5) or
(T.LStr[1]<>'H') or
(T.LStr[5]<>'o') then
begin
writeln('Error!');
halt(1);
end;
End.