This code originally ran in Turbo Pascal,
and has run on non-Borland flavours of Pascal,
so it makes little use of recent Borland innovations [ie, exceptions].
You may think it does not much look like Delphi !

Arrays and matrices of strings and real numbers
are implemented in my own way -- not using the StringLists
or dynamic arrays which were introduced for Delphi
and will not work on non-borland flavours of pascal.

Most likely you will have to write conversion routines
which translate between your own data structures (or those
provided by Delphi) and the data structures defined in units
MYSTRUCS and NEWDIM.

There is a heavy use of pointers -- you are responsible
for managing memory. The main rules are:
* pointers should be nil when not in use
* avoid "dangling pointer", which  occurs when pointer points to object
   which is now gone.

Generally, pointers must be nil on entry to an allocation routine.
Freeing routines free memory and set pointers to nil
Freeing routines also accept nil pointers [but then do nothing].

Also remember that when a Borland pascal program finishes
all memory on the heap is automatically returned to Windows.
Therefore, for a command-line programs that does one thing,
then close, there may be no need to explicitly free objects.

GEMPACK internally represents a 3x4x5 array as a 7-dimensional
fortran array size 3*4*5*1*1*1*1. In the Pascal code, a far more
efficient system is to reverse the order and store
the array as 1*1*1*1*5*4*3. So you see code like:
    OrigNDim := 3;
    for q := 1 to 7 do OrigDims[q] := 1;
    OrigDims[7] := 3; OrigDims[6] := 4; OrigDims[5] := 5;
    if not AllocMat7(HeadMat, OrigDims, Emes) then goto BadEnd;
    for c := 1 to 5 do
      for b := 1 to 4 do
        for a := 1 to 3 do
          HeadMat.Root^[1]^[1]^[1]^[1]^[c]^[b]^[a] := .......

Root is a pointer to an array of pointers to arrays of pointers
to arrays of pointers ...........to arrays of singles.

First, practice READING har files -- which is easier.
Later you might try to create new headers and write them to file.

Creating labelled real matrices is hardest of all -- GEMPACK
programs will usually be happy to read the unlabelled RL type of matrix.
Often it is best to create a HAR file without labels and use
a TABLO-generated program to attach sets to the matrices.

A file COMPILE.DIR is "included" at the top of
each unit file and the main program.
This [rather than the Delphi IDE] will control the compiler settings.
If you put the units in a separate folder from the main DPR program:
* put compile.dir in the same folder as the DPR
* Do NOT have a file compile.dir in the folder with the units

Prior to GEMPACK 9, you cannot read an SL4 file directly; use SLTOHT to make a SOL
[HAR version of SL4] which you can read. Even with GEMPACK 9 or later, SLTOHT may be
the simpler route. 


