GLUECUT (C) by Vladimir Kladov, 2003
VERSION 1.0, 24-Dec-2003
------------------------------------
This is a utility to convert KOL.PAS
created initially for Delphi2-7 for
Windows32 platform only to some other
versions compatible with other
compilers or/and target platforms.

KOL.PAS of version 1.89 or higher
required, containing section
separators and directives defined
below, and command file prepared.

Certainly, this utility can be used
with another source files too.

====================================
Usage:unpack GLUECUT.EXE to the same
directory where KOL.PAS is located,
and run it there (double-click in
the Explorer window, for example, if
a command file is named CMD or if
you want to enter name of CMD file
by a request).

Command line:

GLUECUT [/I:sourcefilepath]
        [/O:targetdirectory]
        [[/C[MD]:]commandfilename]

defaults:
/I:KOL.pas
/O:OUT
/C:CMD

default base directory to find input
and command files is a directory
from where GlueCut is started.

-------------------------------------
THEORY.

The source should have some labels
in form of //comment started in the
1st column of the line. Such labels
listed in the command file define
"sections" containing directives
certain for each section.
E.g.:

//: FILES DEFINITION :
...
//: REGISTRY DEFINITION :
...
//: TObj DEFINITION
...

A list of directives (may be yet not
complete), not case-sensitive:

SKIP [patternfrom] [patternto]
                - skip all the text
                between two patterns
                while copying

REPLACE [patternfrom] [textto]
                - replace all the
                occurances of
                [patternfrom] to the
                given [textto] (both
                without brackets)
                while copying

INCLUDE [filename]
                - include a file

TEXT --
  add a text until a line containing
  symbols "--" only (it is possible
  to use other pattern including one
  empty, in the last case an empty
  line is waiting for).
--

LINE            - inserts source file
                line number (and
                filename) into the
                output

COPY            - copy entire section
                to current output
                file

COPY [filename] - copy entire section
                to a filename. When
                the filename found
                the second (and
                further) time, the
                text is appended

#any comment

REWIND          - reset to the first
                line in the source
                and search following
                section separator

to skip entire section, just do not
use COPY in it. An order of commands
can be important, since COPY, INCLUDE
are executed immediately. All the lines
before the first section separator and
following the last one are copyied
"as is" using currently defined
output file. At the starting part,
a directive /OUT:directory\path can be
defined, which provides default output
directory (it can be overriden by the
option /O:directory in the command
line). In this part, a set of SKIP and
REPLACE directives can be defined which
has effect in all the sections below.
Such directives therefore are discarded
when REWIND executed, but another set
of such global commands can be defined
just following REWIND directive.

====================================
http: //bonanzas.rinet.ru
mailto: bonanzas@online.sinor.ru
