home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
os2
/
datofunk.zip
/
KALENDER.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1994-01-23
|
2KB
|
70 lines
program kalender;
{****************************************************************************}
{* KALENDER - Demonstration af DATOFUNK.TPU - Tool for datoberegning *}
{* 23.1.94/HK *}
{****************************************************************************}
uses
datofunk,crt;
var
firstdag: dagnrt;
key: char;
procedure showcal(fra: dagnrt);
var
i: longint;
begin{showcal}
gotoxy(1,5);
writeln(copy(dato(fra),5,2),'.',copy(dato(fra),1,4));
writeln('Uge Man Tir Ons Tor Fre L¢r S¢n');
write('--------------------------------');
if fra mod 7 <> 1 then begin
writeln;
write(uge(fra):3,' ');
for i:=1 to (fra-1) mod 7 do write(' ');
end;
i:=fra;
while copy(dato(fra),1,6)=copy(dato(i),1,6) do begin
if i mod 7=1 then begin
writeln;
write(uge(i):3,' ');
end{if};
if arbejdsdag(i) then write(' ') else write('*');
write(copy(dato(i),7,2),' ');
inc(i);
end{while};
clreol; writeln;
writeln('--------------------------------'); clreol;
writeln; clreol;
end{showcal};
begin{kalender}
clrscr;
writeln;
writeln('Kalender. Demo af DATOFUNK.TPU. 22.1.94/HK');
writeln('Tryk PgUp/PgDn. Esc for slut');
writeln;
firstdag:=dag(copy(dato(idag),1,6)+'01');
showcal(firstdag);
repeat
key:=#0;
if keypressed then begin
key:=readkey;
case key of
'Q':
begin
firstdag:=dag(copy(dato(firstdag+40),1,6)+'01');
showcal(firstdag);
end;
'I':
begin
firstdag:=dag(copy(dato(firstdag-5),1,6)+'01');
showcal(firstdag);
end;
end{case};
end{if};
until key=#27;
end{kalender}.