* CrtOpen, CrtClose, CrtRead, CrtWrite and CrtReturn changed to procedures, instead of functions

git-svn-id: trunk@25506 -
This commit is contained in:
nickysn 2013-09-17 11:17:29 +00:00
parent 5aa919c2a8
commit 96c7a9325a
4 changed files with 20 additions and 40 deletions

View File

@ -591,7 +591,7 @@ begin
end;
Function CrtWrite(var f : textrec):integer;
Procedure CrtWrite(var f : textrec);
var
i : longint;
begin
@ -600,11 +600,10 @@ begin
WriteChar(f.buffer[i]);
SetScreenCursor(CurrX,CurrY);
f.bufpos:=0;
CrtWrite:=0;
end;
Function CrtRead(Var F: TextRec): Integer;
Procedure CrtRead(Var F: TextRec);
procedure BackSpace;
begin
@ -690,24 +689,21 @@ Begin
until false;
f.bufpos:=0;
SetScreenCursor(CurrX,CurrY);
CrtRead:=0;
End;
Function CrtReturn(Var F: TextRec): Integer;
Procedure CrtReturn(Var F: TextRec);
Begin
CrtReturn:=0;
end;
Function CrtClose(Var F: TextRec): Integer;
Procedure CrtClose(Var F: TextRec);
Begin
F.Mode:=fmClosed;
CrtClose:=0;
End;
Function CrtOpen(Var F: TextRec): Integer;
Procedure CrtOpen(Var F: TextRec);
Begin
If F.Mode=fmOutput Then
begin
@ -721,7 +717,6 @@ Begin
TextRec(F).FlushFunc:=@CrtReturn;
end;
TextRec(F).CloseFunc:=@CrtClose;
CrtOpen:=0;
End;

View File

@ -1252,7 +1252,7 @@ begin
end;
Function CrtWrite(Var F: TextRec): Integer;
Procedure CrtWrite(Var F: TextRec);
{
Top level write function for CRT
}
@ -1276,11 +1276,10 @@ Begin
end;
ttySetFlush(oldFLush);
CrtWrite:=0;
End;
Function CrtRead(Var F: TextRec): Integer;
Procedure CrtRead(Var F: TextRec);
{
Read from CRT associated file.
}
@ -1340,27 +1339,24 @@ Begin
if not(OutputRedir or InputRedir) then
CrtWrite(F)
else F.BufPos := 0;
CrtRead:=0;
End;
Function CrtReturn(Var F:TextRec):Integer;
Procedure CrtReturn(Var F:TextRec);
Begin
CrtReturn:=0;
end;
Function CrtClose(Var F: TextRec): Integer;
Procedure CrtClose(Var F: TextRec);
{
Close CRT associated file.
}
Begin
F.Mode:=fmClosed;
CrtClose:=0;
End;
Function CrtOpen(Var F: TextRec): Integer;
Procedure CrtOpen(Var F: TextRec);
{
Open CRT associated file.
}
@ -1377,7 +1373,6 @@ Begin
TextRec(F).FlushFunc:=@CrtReturn;
end;
TextRec(F).CloseFunc:=@CrtClose;
CrtOpen:=0;
End;

View File

@ -580,7 +580,7 @@ begin
end;
Function CrtWrite(var f : textrec):integer;
Procedure CrtWrite(var f : textrec);
var
i : longint;
begin
@ -589,11 +589,10 @@ begin
WriteChar(f.buffer[i]);
SetScreenCursor(CurrX,CurrY);
f.bufpos:=0;
CrtWrite:=0;
end;
Function CrtRead(Var F: TextRec): Integer;
Procedure CrtRead(Var F: TextRec);
procedure BackSpace;
begin
@ -676,24 +675,21 @@ Begin
until false;
f.bufpos:=0;
SetScreenCursor(CurrX,CurrY);
CrtRead:=0;
End;
Function CrtReturn(Var F: TextRec): Integer;
Procedure CrtReturn(Var F: TextRec);
Begin
CrtReturn:=0;
end;
Function CrtClose(Var F: TextRec): Integer;
Procedure CrtClose(Var F: TextRec);
Begin
F.Mode:=fmClosed;
CrtClose:=0;
End;
Function CrtOpen(Var F: TextRec): Integer;
Procedure CrtOpen(Var F: TextRec);
Begin
If F.Mode=fmOutput Then
begin
@ -707,7 +703,6 @@ Begin
TextRec(F).FlushFunc:=@CrtReturn;
end;
TextRec(F).CloseFunc:=@CrtClose;
CrtOpen:=0;
End;

View File

@ -689,7 +689,7 @@ begin
end;
Function CrtWrite(var f : textrec) : integer;
Procedure CrtWrite(var f : textrec);
var
i : longint;
s : string;
@ -726,10 +726,9 @@ begin
SetConsoleOutputCP(OldConsoleOutputCP);
f.bufpos:=0;
CrtWrite:=0;
end;
Function CrtRead(Var F: TextRec): Integer;
Procedure CrtRead(Var F: TextRec);
procedure BackSpace;
begin
@ -830,24 +829,21 @@ Begin
f.bufpos:=0;
SetScreenCursor(CurrX, CurrY);
CrtRead:=0;
End;
Function CrtReturn(Var F:TextRec):Integer;
Procedure CrtReturn(Var F:TextRec);
Begin
CrtReturn:=0;
end;
Function CrtClose(Var F: TextRec): Integer;
Procedure CrtClose(Var F: TextRec);
Begin
F.Mode:=fmClosed;
CrtClose:=0;
End;
Function CrtOpen(Var F: TextRec): Integer;
Procedure CrtOpen(Var F: TextRec);
Begin
If F.Mode=fmOutput Then begin
TextRec(F).InOutFunc:=@CrtWrite;
@ -858,7 +854,6 @@ Begin
TextRec(F).FlushFunc:=@CrtReturn;
end;
TextRec(F).CloseFunc:=@CrtClose;
CrtOpen:=0;
End;