Contents of the READ.ME file
CLPARSER.TPU (c)1989, 1990 Greg Truesdell
Version 3.0 a Turbo Pascal 5.5 Object Unit
This disk/archive contains the following files:
CLPARSER.TPU The Command Line Parser Unit
CLPARSER.DOC A reference manual for the unit.
READ.ME This file, obviously.
CLPDEMO.PAS An example file.
CLPDEMO.DAT A sample parameter file
CLPDEMO.MAP The map file for CLPDEMO.EXE
CLPDEMO.EXE The compiled version of the example program.
DEMO.BAT A sample demo of CLPDEMO.EXE.
Resgistered users also receive:
MODSYS.EXE Program to modify your SYSTEM.TPU file. See below.
YAPL.PAS A non-trivial example of CLPARSER's use.
YAPL.MAP The map file for YAPL.EXE (note smart linked size)
YAPL.EXE Yes, Another Program Lister executable.
Source Licencees also receive:
CLPARSER.PAS Licensed Source for CLPARSER v3.0
The program file YAPL.PAS has been added to the distribution disk as a
NON-TRIVIAL example of how CLPARSER can be used. It is in no way intended
to be the definitive work on how CLPARSER should be used. I have tried
a number of approaches and some are better than others. Take a look at
the use of object pointer switching used to select either a switch object
or a pfile object as input. You might also find the program useful.
It seems to me, however, that we've seen enough YAPLs (pronounced YAPPLE)
to do for awhile.
THE .EXE FILES WERE COMPILED WITH A MODIFIED VERSION OF SYSTEM.TPU
MOVED INTO TURBO.TPL. THIS ALLOWS SWITCHES WHICH START WITH "/" TO
BE CONCATENATED WITHOUT A SPACE. (ie: hello/a/b filename ... )
SEE SECTION "MODIFICATIONS TO RTL" FOR MORE INFORMATION
A number of changes have been made to this version of the CLPARSER source
code. Please read the CHANGES comments in CLPARSER.DOC for more
MODIFICATIONS TO RTL_______________________________________________________
Turbo Pascal v5.5 Run Time Library file PARS.ASM (PARS.OBJ) includes what I
would consider a deficiency. When loading the command line arguments into
the ParamStr() array, the SPACE ($20) character is used as a delimiter. In
most cases this is fine. It can be annoying, though, when you have become
accustomed to command lines like:
C:\DOS> myexe/q filename /a/f
Turbo Pascal would pass "/a/f" as a single parameter. This can be overcome
in your own code, if you wish. I have not dealt with that issue in
CLPARSER. Since the Turbo Pascal RTL is available, I have patched the PARS
assembler source code to accept "/" as a delimiter also. In the PARS.ASM
file at line 99 you need to replace
@@2: CMP BYTE PTR ES:[DI],' '
@@2: CMP BYTE PTR ES:[DI],'/' ; if char is = switch then skip
CMP BYTE PTR ES:[DI],' ' ; if char is > space then skip
and at line 105 you need to replace
@@4: CMP BYTE PTR ES:[DI],' '
@@4: CMP BYTE PTR ES:[DI],' ' ; skip if white space
CMP SI,DI ; ignore next if 1st switch
CMP BYTE PTR ES:[DI],'/' ; skip if switch
@@41: INC DI
If you do not have the Run Time Libraries for TP 5.5, you can still get
this modification applied to your copy. First you must BACK UP!!! Make
working copies of TURBO.TPL and SYSTEM.TPU in a separate directory. Use
Borland's TPUMOVER program to copy SYSTEM.TPU out of TURBO.TPL. Then
run the MODSYS.EXE program provided (registered user's only!) to modify
the copy of SYSTEM.TPU. This should add 16 bytes to the original 30384
bytes (now 30400 bytes). If this process is successful, then, AND ONLY
THEN, use TPUMOVER to install the new SYSTEM.TPU file into TURBO.TPL.
There are no guarentees that this will work. I am assuming that all
copies of SYSTEM.TPU are the same. If not, you will need the RTL files
from Borland. Then you will have to make changes to PARS.ASM as detailed
above. See the Borland RTL documentation for information on how to do