It can roll any text in the text window up or down

Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Category: Source in Pascal

Program: Rolovan.pas
File exe: Rolovan.exe
File ubuntu: Rolovan

It can roll any text in the text window up or down. Controlled by arrows.
{ ROLOVAN.PAS               Copyright (c) TrSek alias Zdeno Sekerak }
{ Program vie rolovat lubovolne textove okno nahor alebo nadol.     }
{ Ovladanie sipkami.                                                }
{                                                                   }
{ Datum:11.02.1992                             http://www.trsek.com }
 
program rolovanie;
uses crt,dos;
var i:integer;
    ch:char;
 
{ aktualne okno roluje nahor }
procedure RolujHore(x1,y1,x2,y2:integer);
var reg:registers;
begin
 with reg do begin
   ah:=$06;
   al:=1;  bh:=0;
   ch:=y1; cl:=x1;
   dh:=y2; dl:=x2;
   end;
 intr($10,reg);
end;
 
 
{ aktualne okno roluje dole }
procedure RolujDole(x1,y1,x2,y2:integer);
var reg:registers;
begin
 with reg do begin
   ah:=$07;
   al:=1;  bh:=0;
   ch:=y1; cl:=x1;
   dh:=y2; dl:=x2;
   end;
 intr($10,reg);
end;
 
 
Begin
  ClrScr;
  for i:=32 to 255 do
    Write(i:3,' - ',chr(i),' ');
 
  WriteLn; WriteLn;
  WriteLn('Sipky - roluj hore,dole');
  WriteLn('ESC   - koniec');
 
  repeat
    ch:=readkey;
    if (ch=#0) then ch:=readkey;
 
    if (ch=#72) then RolujHore(4,2,70,20);
    if (ch=#80) then RolujDole(4,2,70,20);
 
  until (ch=#27);
end.