mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 01:05:56 +02:00
+ Initial implementation of examples
This commit is contained in:
parent
38379e14b9
commit
d9749fb889
5
docs/sysutex/README
Normal file
5
docs/sysutex/README
Normal file
@ -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
docs/sysutex/ex1.pp
Normal file
13
docs/sysutex/ex1.pp
Normal file
@ -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
docs/sysutex/ex2.pp
Normal file
9
docs/sysutex/ex2.pp
Normal file
@ -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
docs/sysutex/ex3.pp
Normal file
10
docs/sysutex/ex3.pp
Normal file
@ -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
docs/sysutex/newex
Normal file
9
docs/sysutex/newex
Normal file
@ -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
docs/sysutex/template.pp
Normal file
8
docs/sysutex/template.pp
Normal file
@ -0,0 +1,8 @@
|
||||
Program Example;
|
||||
|
||||
{ This program demonstrates the *** function }
|
||||
|
||||
Uses sysutils;
|
||||
|
||||
Begin
|
||||
End.
|
Loading…
Reference in New Issue
Block a user