Skip to content

Commit

Permalink
add getdate sample
Browse files Browse the repository at this point in the history
  • Loading branch information
tranleduy2000 committed Jun 20, 2017
1 parent 12baab9 commit bc5109c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions libCompiler/src/main/assets/code_sample/dos/GetDate.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Program Example2;
uses Dos;

{ Program to demonstrate the GetDate function. }

const
DayStr : array[0..6] of string[3] = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
MonthStr : array[1..12] of string[3] = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
var
Year, Month, Day, WDay : word;
begin
GetDate(Year, Month, Day, WDay);
WriteLn('Current date');
WriteLn(DayStr[WDay], ', ', Day, ' ', MonthStr[Month], ' ', Year, '.');
end.

0 comments on commit bc5109c

Please sign in to comment.