From bc5109c83aa1f30ef98a09927ed73d26e3016821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=E1=BA=A7n=20L=C3=AA=20Duy?= Date: Wed, 21 Jun 2017 05:35:05 +0700 Subject: [PATCH] add getdate sample --- .../src/main/assets/code_sample/dos/GetDate.pas | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 libCompiler/src/main/assets/code_sample/dos/GetDate.pas diff --git a/libCompiler/src/main/assets/code_sample/dos/GetDate.pas b/libCompiler/src/main/assets/code_sample/dos/GetDate.pas new file mode 100644 index 00000000..91a5137c --- /dev/null +++ b/libCompiler/src/main/assets/code_sample/dos/GetDate.pas @@ -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. \ No newline at end of file