This page contains a few old programs I have published for Turbo/Borland
Pascal (BP). Some of them are obsolete, just like I consider this whole
compiler obsolete. Don't expect anything new here in the future.

My current programs, mostly written for GNU Pascal can be found on my
programs page.

To find links to other interesting places on the net, please visit my links
page.

Features of a modern "OS": drag & drop ... plug & pray ... click & crash
...

The Hitch Hiker's Guide to the Galaxy ... says of the Sirius Cybernetics
Corporation products that "it is very easy to be blinded to the essential
uselessness of them by the sense of achievement you get from getting them
to work at all. In other words - and this is the rock solid principle on
which the whole of the Corporation's Galaxy-wide success is founded - their
fundamental design flaws are completely hidden by their superficial design
flaws." (Douglas Adams: "So long, and thanks for all the fish")

Content:

   * NewDelay - Fix for bug in Crt unit's Delay procedure (TP 6.0-BP 7.0)
   * Some BP TFDDs: Read text files with different newline characters (e.g.
     Un*x files on Dos); Log text files to other text files; Use Write
     formatting for output to strings (BP 7.0)
   * Trap - Runtime error trap (obsolete for BP)
   * WWin - CRT extension for Windoze (obsolete)

NewDelay 1.00

Fix for bug in Crt unit's Delay procedure

Symptom
     Programs written in Turbo/Borland Pascal give a run time error 200
     (divide by zero) at the start when running on a fast processor, e.g.
     on an P200 Pro. Actually not all programs are affected, but only those
     that use Crt.
Explanation
     The initialization code in the Crt unit that belongs to the Delay
     procedure has a bug.
Solution
     I wrote a patch to fix that bug. You can download newdelay.pas here.
     The patch should work on older machines just as well as the original
     Crt's Delay procedure. It requires TP 6.0 or TP/BP 7.00/7.01. The
     current version is now also able to patch Crt at runtime, allowing the
     fix to work even without having the source code of Crt. Another
     feature of that patch is that Delay tries to avoid busy waiting by
     giving up timeslices when running in a multitasking environment (like
     e.g. Linux or Windoze). This reduces the CPU load.
See also
        o John Stockton's Pascal Page, discussing the way Delay works and
          the resulting bugs.
        o Timo Salmi's Turbo Pascal FAQ, discussing this problem as well as
          another, older problem with Delay
        o R.E. Donais' rdelay patch (TP 4.0 - BP 7.0)

Some BP TFDDs

Read text files with different newline characters (e.g. Un*x files on Dos)

The unit CrLf allows Turbo/Borland Pascal programs to read text files with
different newline character combinations than the CR/LF combination used
under Dos. Currently, files with only CR or only LF as newline can be read
just like files with CR/LF via the usual Read and Readln procedures. The
newline characters supported can be changed in the implementation part of
the unit.

Log text files to other text files

The unit TextLog allows Turbo/Borland Pascal programs to log text files,
i.e. all text that is read from or written to the file is copied to the log
file.

Use Write formatting for output to strings

The Extended Pascal standard provides the statement WriteStr to write
output into strings with all the comfortable formatting available as in
Write and Writeln. Unfortunately, Borland Pascal doesn't have this
statement. With the unit WriteStr, you can get a simulation of WriteStr
that works quite similarly in BP.

These units, together with short demo programs can be found in bp-tfdd.zip.

Trap

Runtime error trap (obsolete for BP)

The unit Trap serves to trap runtime errors, so an error will not abort the
program but pass the control back to the program. The current version of
this unit is part of GNU Pascal. The Borland Pascal version of the unit is
not supported anymore.

WWin

CRT extension for Windoze (obsolete)

The unit WWin that can be found on some shareware sites is not supported
anymore. I don't accept any registrations anymore. There will be no version
for Delphi.

The CRT unit of GNU Pascal contains all the extensions WWin did and much
more, is portable to just about any system, and GNU Pascal is a more modern
compiler, anyway.

  ------------------------------------------------------------------------

The links on this page are references provided for informational purposes
only. The contents of the sites linked to do not constitute part of the
content of this page. I'm not responsible for those contents.

No guarantees for correctness, accuracy or usefulness of the information
above! No responsibility for any damages caused by this information!

For feedback, bug reports, comments about this page or about the referenced
programs, please mail me: frank(at)pascal.gnu.de or fjf(at)gmx.de (Sorry,
no mailto URL to prevent Spam!)
Please write to only one of the addresses!

Copyright 1996-2001 by Frank Heckenbach, last updated 2001-10-29

[Best Viewed With Any Browser] [Valid HTML 4.0]
