HP Pascal/iX Programmer's Guide (31502-90023)
B- 13
and it compiles and links successfully, then its object file,
prog.o, is not saved.
Example
The command:
pc main.p ext1.p ext2.p
compiles the object files main.o, ext1.o, and ext2.o, into the final
program file a.out. It is equivalent to the command sequence:
pc -c main.p
pc -c ext1.p
pc -c ext2.p
pc main.o ext1.o ext2.o
NOTE The HP Pascal compiler ignores the following Series 300
pc
command
options without warning:
+X
+x
+M
+b
+bfpa
+f
+ffpa
Run-Time Parameters
You can pass run-time parameters to your program as HP-UX command-line
arguments when starting your program.
No arguments are automatically bound to program parameters. Even the
three pre-opened (standard) files,
stdin
,
stdout,
and
stderr
are only
bound to the HP Pascal textfiles
input, output,
and
stderr
if the program
heading declares the textfiles.
Other run-time parameters must be obtained from the command line
arguments by importing the predefined module
arg
and using the routines
that it exports, which are:
Function Return Value
argc
The total number of program arguments. (This
integer is greater than or equal to one, because
every HP-UX program has at least one program
parameter, the program name.)
argn
An HP Pascal string that contains the
n
th program
argument, where
n
is an argument to
argn
and must
be in the range 0..
argc
- 1. If
n
is outside this
range, the run-time library generates a range
error. The call
argn(0)
returns the program name.
argv
A pointer to a null-terminated array of pointers,
each of which points to a null-terminated PAC that
contains an argument (see the export section of the
arg
module, on the next page).
The module
arg
belongs to the default module library /usr/lib/paslib;
therefore, your program can import it without specifying a library with
the SEARCH compiler option.