==============================
Turbo Pascal for Dos
==============================
program Clock;
uses Dos;
var
Year, Month, Day, DayOfWeek: word;
Hour, Min, Sec, MiniSec: word;
begin
GetDate(Year, Month, Day, DayOfWeek);
GetTime(Hour, Min, Sec, MiniSec);
writeln('Today is ', Day, '/', Month, '/', Year);
writeln('This week remains ', 7 - DayOfWeek, ' days.');
writeln('And the time now is ', Hour, ':', Min, ':', Sec, '.', MiniSec);
end.
==============================
Turbo Pascal 1.5 for Windows
==============================
program Clock;
uses WinDos, WinCrt;
var
Year, Month, Day, DayOfWeek: word;
Hour, Min, Sec, MiniSec: word;
begin
GetDate(Year, Month, Day, DayOfWeek);
GetTime(Hour, Min, Sec, MiniSec);
writeln('Today is ', Day, '/', Month, '/', Year);
writeln('This week remains ', 7 - DayOfWeek, ' days.');
writeln('And the time now is ', Hour, ':', Min, ':', Sec, '.', MiniSec);
end.
==============================
Variables of Procedures
==============================
1. GetDate ( 年份 , 月份 , 日期 , 星期幾 );
2. GetTime ( 小時 , 分鐘 , 秒數 , 毫秒 );
** 所有 Variables 要宣告為 word