mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-09 21:46:13 +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
|
Type tLongStr=Object // try to change this
|
||||||
// to Record
|
// to Record
|
||||||
LStr:Array[1..LONG_STR_SIZE] Of Char;
|
LStr:Array[0..LONG_STR_SIZE] Of Char;
|
||||||
LLength:Longint;
|
LLength:Longint;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
Operator := (S:String) R:tLongStr;
|
Operator := (S:String) R:tLongStr;
|
||||||
Begin
|
Begin
|
||||||
R.LLength:=Length(S);
|
R.LLength:=Length(S);
|
||||||
@ -21,4 +22,12 @@ Var T:tLongStr;
|
|||||||
|
|
||||||
Begin
|
Begin
|
||||||
T:='Hello';
|
T:='Hello';
|
||||||
|
if (T.LLength<>5) or
|
||||||
|
(T.LStr[1]<>'H') or
|
||||||
|
(T.LStr[5]<>'o') then
|
||||||
|
begin
|
||||||
|
writeln('Error!');
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
|
|
||||||
End.
|
End.
|
||||||
|
Loading…
Reference in New Issue
Block a user