From f43d2d17e42762232699e6cf6d3714e01a1ab35c Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 7 Nov 2001 21:50:40 +0000 Subject: [PATCH] * copied from fvnew the changed that I made toremove runerror(199) --- fv/histlist.pas | 23 ++++++++++++++++++++--- fvision/histlist.pas | 23 ++++++++++++++++++++--- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/fv/histlist.pas b/fv/histlist.pas index 1fd26067a1..6929bfa6ff 100644 --- a/fv/histlist.pas +++ b/fv/histlist.pas @@ -240,9 +240,23 @@ END; {---------------------------------------------------------------------------} PROCEDURE InsertString (Id: Byte; Const Str: String); VAR P1, P2: PChar; + P : PHistRec; BEGIN - While ((HistoryUsed-LongInt(HistoryBlock) + - Length(Str) > HistorySize)) Do RunError(199); { Check sufficient memory } + while (HistoryUsed+Length(Str)+3>HistorySize) do + begin + P:=PHistRec(HistoryBlock); + while Pointer(P) + Pointer(HistoryBlock)+HistorySize then + begin + HistoryUsed:=HistoryUsed-(Length(P^.Str)+3); + FillChar(P^,Pointer(HistoryBlock)+HistorySize-Pointer(P),#0); + break; + end; + P:=PHistRec(Pointer(P)+Length(P^.Str)+3); + end; + end; P1 := PChar(HistoryBlock)+1; { First history record } P2 := P1+Length(Str)+3; { History record after } Move(P1^, P2^, HistoryUsed - @@ -400,7 +414,10 @@ END. { $Log$ - Revision 1.3 2001-08-04 19:14:33 peter + Revision 1.4 2001-11-07 21:50:40 pierre + * copied from fvnew the changed that I made toremove runerror(199) + + Revision 1.3 2001/08/04 19:14:33 peter * Added Makefiles * added FV specific units and objects from old FV diff --git a/fvision/histlist.pas b/fvision/histlist.pas index 1fd26067a1..6929bfa6ff 100644 --- a/fvision/histlist.pas +++ b/fvision/histlist.pas @@ -240,9 +240,23 @@ END; {---------------------------------------------------------------------------} PROCEDURE InsertString (Id: Byte; Const Str: String); VAR P1, P2: PChar; + P : PHistRec; BEGIN - While ((HistoryUsed-LongInt(HistoryBlock) + - Length(Str) > HistorySize)) Do RunError(199); { Check sufficient memory } + while (HistoryUsed+Length(Str)+3>HistorySize) do + begin + P:=PHistRec(HistoryBlock); + while Pointer(P) + Pointer(HistoryBlock)+HistorySize then + begin + HistoryUsed:=HistoryUsed-(Length(P^.Str)+3); + FillChar(P^,Pointer(HistoryBlock)+HistorySize-Pointer(P),#0); + break; + end; + P:=PHistRec(Pointer(P)+Length(P^.Str)+3); + end; + end; P1 := PChar(HistoryBlock)+1; { First history record } P2 := P1+Length(Str)+3; { History record after } Move(P1^, P2^, HistoryUsed - @@ -400,7 +414,10 @@ END. { $Log$ - Revision 1.3 2001-08-04 19:14:33 peter + Revision 1.4 2001-11-07 21:50:40 pierre + * copied from fvnew the changed that I made toremove runerror(199) + + Revision 1.3 2001/08/04 19:14:33 peter * Added Makefiles * added FV specific units and objects from old FV