mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-01 22:02:36 +02:00
* runtime check
This commit is contained in:
parent
73a08fc4a6
commit
133a9aa958
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user