Contents of the PARSECMD.TXT file
This text explains then method I use in my programs to parse the
program input parameters.
If there is only a ? given then a command summary is displayed.
The Parameters are compiled from three sources:
1. An evironment varible the same as the program name.
2. An ASCII file[s].
3. The command tail.
If the evironment variable begins with a + it is appended to the
command tail otherwise it is prepended. The result is then parsed.
If a parm file specification is incountered, (beginning with an @),
then the file contents are inserted into the command string in place
of the @ parameter. There can be multiple parm files used.
Strings can be enclosed with single (') or double (") quotes.
Either quote can be entered by enclosing it in the other. ("'")
Two consecutive switch characters will change the switch to the
next character. Example: sw is / then //- changes it to -.
Parameters which do not begin with the switch character are
counted and used in rotation. For example if the program accepts 2
non-switch parameters and the input is 'abc def ghi', then the result
would be the same as 'ghi def'.
Program accepts 2 filenames and toggle switches.
File PARMA contains:
File PARMB contains:
Command line: PROGNAME filex /x
Would give : PROGNAME fileb filex /x /k
Command line: PROGNAME filex @parma /k
Would give : PROGNAME filea filex /d /q
Command line: PROGNAME @parma filex
Would give : PROGNAME filex filea /k /d /q
Command line: PROGNAME @parma @parmb
Would give : PROGNAME filed filea /k /d /q /e