Frank Heckenbach wrote:
... snip ...
Automatically assigning addtional files mentioned in the header to the names given in arguments has been discussed, but I'm not really convinced of its usefulness. Many programs need to accept options apart from file names. So this 1:1 mapping would work only for simple cases.
PascalP did that, but limited it to names mentioned within parentheses. I.E:
PROGRAM foo(alpha, beta, gamma, input, output) .... BEGIN .... END.
could be run with a command line explicitly using parentheses:
foo (file1, , file3)
and would access alpha, beta, gamma (assuming declared to be files) as the local files named file1, beta, file3. This only changed the default local ids attached to those files, and could still be over-ridden.
For detailed command line work the whole command line was available to the program as the one line text file named "cmd". So something like:
VAR cmd : text; BEGIN reset(cmd); (* The default id for a file is the Pascal name *) read(cmd, somewhere); ...
would gather the command line for programmatic parsing and usage. Redirection with < and > is stripped from the command line.