浏览代码

+ Initial implementation of examples

michael 26 年之前
父节点
当前提交
d9749fb889
共有 6 个文件被更改,包括 54 次插入0 次删除
  1. 5 0
      docs/sysutex/README
  2. 13 0
      docs/sysutex/ex1.pp
  3. 9 0
      docs/sysutex/ex2.pp
  4. 10 0
      docs/sysutex/ex3.pp
  5. 9 0
      docs/sysutex/newex
  6. 8 0
      docs/sysutex/template.pp

+ 5 - 0
docs/sysutex/README

@@ -0,0 +1,5 @@
+This directory contains the examples for the Sysutils unit.
+
+ex1.pp contains an example of the Date function.
+ex2.pp contains an example of the DateTimeToFileDate function.
+ex3.pp contains an example of the DateTimeToStr function.

+ 13 - 0
docs/sysutex/ex1.pp

@@ -0,0 +1,13 @@
+Program Example1;
+
+{ This program demonstrates the Date function }
+
+uses sysutils;
+
+Var YY,MM,DD : Word;
+
+Begin
+ Writeln ('Date : ',Date);
+ DeCodeDate (Date,YY,MM,DD);
+ Writeln (format ('Date is (DD/MM/YY): %d/%d/%d ',[dd,mm,yy]));
+End.

+ 9 - 0
docs/sysutex/ex2.pp

@@ -0,0 +1,9 @@
+Program Example2;
+
+{ This program demonstrates the DateTimeToFileDate function }
+
+Uses sysutils;
+
+Begin
+  Writeln ('FileTime of now would be: ',DateTimeToFileDate (Now)); 
+End.

+ 10 - 0
docs/sysutex/ex3.pp

@@ -0,0 +1,10 @@
+Program Example3;
+
+{ This program demonstrates the DateTimeToStr function }
+
+Uses sysutils;
+
+Begin
+  Writeln ('Today is : ',DateTimeToStr(Now));
+  Writeln ('Today is : ',FormatDateTime('c',Now));
+End.

+ 9 - 0
docs/sysutex/newex

@@ -0,0 +1,9 @@
+#!/bin/sh
+if [ -e ex${1}.pp ]; then
+  mv ex${1}.pp ex${1}.pp.orig
+fi
+sed -e s/Example/Example$1/ -e s/\\\*\\\*\\\*/$2/ <template.pp >ex${1}.pp
+echo "ex${1}.pp contains an example of the $2 function." >>README
+joe ex${1}.pp
+ppc386 ex${1}.pp && ex${1}
+rm ex${1}.o

+ 8 - 0
docs/sysutex/template.pp

@@ -0,0 +1,8 @@
+Program Example;
+
+{ This program demonstrates the *** function }
+
+Uses sysutils;
+
+Begin
+End.