Param_File_Type paramopen( paramfilename )
Param_File_Type paramopen( paramfilename, mode )
Param_File_Type paramopen( paramfilename, mode, arglist )
Param_File_Type paramopen( NULL, mode, arglist )
Open a parameter file, returning a file pointer which
can be used with the other paramio functions.
If you are going to be accessing the same parameter file multiple
times then it is more efficient to use the Param_File_Type
variable returned by paramopen() in the function calls
rather than to repeatedly use the name of the tool.
The mode defaults to "r" and should be one of the
"IRAF-compatible" paramater-interface access modes
(eg "r", "rw", "rH", etc).
If the arglist is supplied then it should be a String_Type
array containing parameter settings that over-ride those
given in the parameter file. The first element of the array
should contain the name of the tool (i.e. the name used
to access the parameter file), and - as of CIAO 3.2 - the first argument can be set to NULL when used in this form. If used from slsh then
using __argv for arglist will allow you to process
the command-line arguments of the script through the
parameter library. See "ahelp paramio" for an example
of how this can be used to add parameter handling to
a S-Lang script.
As with all the paramio routines, the PF_Errno variable
is set to 0 on success, or on error it is set to
one of the error codes listed in the paramio documentation.
require("paramio");
variable fp = paramopen("dmextract");
vmessage( "The opt parameter=%s", pget(fp,"opt") );
paramclose( fp );
Open the parameter file for the dmextract tool.
As no mode is given it defaults to "r" - ie read-only.
The variable returned by paramopen() is then used in
a call to pget() to find out the value of the "opt"
parameter, before the parameter file is closed
via the call to paramclose().
When the three-argument form of paramopen() is used, the parameter file name is taken from the first element of the arglist array. This means that:
- The first argument of paramopen() - i.e. paramfilename - can be set to NULL in this case.
- Parameter files specified on the command-line using the "@@" syntax will now be correctly handled (for slsh scripts which set arglist to be equal to __argv).
- concept
-
parameter
- modules
-
paramio
- paramio
-
paccess,
paramclose,
pget,
pgets,
plist_names,
pquery,
pset,
punlearn
- tools
-
dmhistory,
dmkeypar,
dmmakepar,
dmreadpar,
paccess,
pdump,
pget,
pline,
plist,
pquery,
pset,
punlearn
|