Dates and Time in the Delila System
The main problem with
is that obtaining the date and time from
the system is not standard in Pascal.
Since many Delila programs stamp
their output with a Date/Time,
the relevant routines must be set to work on
To make this easy, I have packaged the routine
that calls date and time functions into
a procedure called getdatetime.
I then modified this procedure to work on several
The ones I have built so far are:
If you can get any one of these programs to work
on a compiler
(give you the correct date)
then virtually all other Delila programs will also work
on that compiler.
These programs contain standard routines for manipulating date and time
information. This information is used to stamp files to avoid confusion
with printouts. These routines are the only non-standard Pascal calls in
the Delila system.
The routines are:
- getdatetime: gets the date and time in this standard Delila format:
- writedatetime: writes out the date/time.
- readdatetime: reads from a file the date and time in the standard format
- timeseed: creates a random number by reversing the digits of the current
time and placing them after the decimal place.
These timeseeds never repeat and so are ideal for starting random
The package of time routines can
be automatically transferred into Delila programs using
The module program provides a
system independent insertion mechanism.
Module is pure standard Pascal and should compile on all compilers.
How To Use the Module Program
Pascal programs do not have a standard way to interact with system
file names. For simplicity, in the Delila system, we use
standard names for the input and output of programs such as Module.
Suppose we are converting the source code for delmod.p
to GPC using timegpc.p Then
program for more details.
I have found this to be an extremely reliable
mechanism, and it works on all systems.
- Get a copy of the
and compile it. It is 100% pure Pascal and should compile
on any reasonable Pascal compiler.
I recommend the
Be sure to use the
- Copy the source code (input) into
a file named "sin".
cp delmod.p sin
(where cp is the unix copy program).
- Then select the time module library from above
and put it in a file named "modlib".
cp timegpc.p modlib
- Make sure that there is an empty "modcat" file.
Under unix you can do this with:
echo -n "" > modcat
Note that this wipes out the previous contents of
modcat. You may reuse modcat only if you do not
modify the modlib.
- Run the module program.
The result will be in "sout"
and a list of the modules transferred will be in the "list" file.
If you have a backup somewhere, then you can safely
put the results back:
cp sout delmod.p
The result is that the time modules in timegpc.p are now
substituted into delmod.p.
program is the place that I keep the current working modules.
From there the time modules are transferred into various programs.
origin: 2000 Jul 24
updated: 2011 Aug 11
U.S. Department of Health and Human Services
National Institutes of Health
National Cancer Institute