Category : Pascal Source Code
Archive   : TMULTASK.ZIP
Filename : STATLINE.PAS

 
Output of file : STATLINE.PAS contained in archive : TMULTASK.ZIP
{File: STATLINE.PAS ===================================================

This file contains the routines that manage the status line (row 25).

=======================================================================}


{Procedure: UpdateStatusLine ===========================================
Author: E.T.Burleyson Last update: 28 Sept 87

This procedure keeps the row 25 status line row, col, and status item
areas updated. It "wakes up" every 1/6-second to do so. }

Procedure UpdateStatusLine;

{======================================================================}
const
RowColText:string[13] = 'Row= Col= ';
RowColStart = 3; {first column of RowColText}

var
TempStr : String[2];
i : integer; {loop index}
Temp : integer;

begin {UpdateStatusLine}
repeat
pause(1); {go to sleep for one sixth-second interval}
with PhysicalScreen2D^ do begin
str(WhereY,TempStr);
if length(TempStr)<2 then TempStr:='0'+TempStr;

move(TempStr[1],RowColText[5],2);
str(WhereX,TempStr);
if length(TempStr)<2 then TempStr:='0'+TempStr;
move(TempStr[1],RowColText[12],2);
for i := 1 to length(RowColText) do begin
repeat until (8 and port[$3DA])<>0; {wait so no flicker}
Image[25,RowColStart+i-1,Character]:=ord(RowColText[i]);
end; {for}
end; {with}
until false; {loop forever}
end; {UpdateStatusLine}


{Procedure: PutNotice ==================================================
Author: E.T.Burleyson Last update: 28 Sept 87

Request that a notice be displayed in the notice area of the status line. }

Procedure PutNotice(
NText: String40; {the text for the notice}
NColor: integer; {the color attribute for the notice (0=default) }
NSeconds: integer {the number of seconds to leave the notice up
(0=forever) }
);

{======================================================================}
begin {PutNotice}
with StatusLineBuffer do begin
if ovd.ItemCount>0 then begin
WaitFor:=addr(ovd.NotFull);
Wait;
end;
ovd.ItemCount:=1;
Notice:=copy(Ntext+' ',1,40);
if Ncolor=0 then begin
Color:=StatusLineColor;
end {then}
else begin
Color:=lo(NColor);
end; {if}
WaitTime:=NSeconds;
if ovd.NotEmpty<>nil then begin
send(ovd.NotEmpty);
end; {if}
end; {with}
end; {PutNotice}



{Procedure: ProcessNotice ==============================================
Author: E.T.Burleyson Last update: 28 Sept 87

This procedure waits for somebody to use PutNotice and then puts the
specified notice up on line 25. }

Procedure ProcessNotice;

{======================================================================}
var
i: integer; {loop control}
PrevColor: byte;
PrevNotice: string40;

begin {ProcessNotice}
repeat
with StatusLineBuffer do begin
If ovd.ItemCount>0 then begin
PrevColor:=PhysicalScreen2D^.Image[25,19,Attribute];
for i:= 19 to 58 do begin
repeat until (8 and port[$3DA])<>0; {wait so no flicker}
PhysicalScreen2D^.Image[25,i,Attribute]:=Color;
PrevNotice[i-18]:=chr(PhysicalScreen2D^.Image[25,i,Character]);
PhysicalScreen2D^.Image[25,i,Character]:=ord(Notice[i-18]);
end; {for}
if WaitTime>0 then begin
Pause(WaitTime*6);
for i:= 19 to 58 do begin
repeat until (8 and port[$3DA])<>0; {wait so no flicker}
PhysicalScreen2D^.Image[25,i,Attribute]:=PrevColor;
PhysicalScreen2D^.Image[25,i,Character]:=ord(PrevNotice[i-18]);
end; {for}
end; {if}
end; {if}
ovd.ItemCount:=0;
if ovd.NotFull<>nil then begin
send(ovd.NotFull);
end;
WaitFor:=addr(ovd.NotEmpty);
Wait; {sleep until somebody uses PutNotice}
end; {with}
until false;
end; {ProcessNotice}


  3 Responses to “Category : Pascal Source Code
Archive   : TMULTASK.ZIP
Filename : STATLINE.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/