Previous: x/ zvpixsizeu Up: Miscellaneous Routines
call xvselpi(instance) zvselpi(instance);
Selects the file to use as the primary input. The primary input is normally the first file given in the ``INP'' parameter. It is used for a couple of things. If you don't give file attributes like size, type, etc. when you open a file, the defaults are taken from the primary input. Also, when you create a new output file, the history and property labels for the new file are copied from the primary input, in order to maintain the processing history and file attributes.
In the rare cases where the first ``INP'' file is not appropriate for the primary input, calling x/ zvselpi allows you to change the file that is used as the primary input, or to disable the primary input altogether. The file selected must still be one of the files in the ``INP'' parameter. For example, you might be taking input files and creating output files after doing the same processing to each. You would want to set the primary input for each output file to the corresponding input file, in order to preserve the history labels. Or, you may want to create a file with no history labels whatsoever (except for the current task of course).
This routine should be called before the x/ zvopen of the output file you want associated with the input. The only routines that use the primary input directly are x/ zvopen, x/ zvsize, and x/ zvbands. The primary input in effect at the time each of these routines is called determines which input file is used. You may change x/ zvselpi after the x/ zvopen statement, even if you do more processing to the file. It will still use the primary input in effect at the time the file was opened.
It is slightly more efficient to call x/ zvselpi before you open the primary input file for other reasons, because it avoids an extra file open. However, this should not have a big impact.
There is no status return from this routine.
Arguments:
Determines which instance of the ``INP'' parameter to use as the primary input. Numbering starts at one, so you may restore the default behavior by calling x/ zvselpi with an INSTANCE of 1. An INSTANCE of 4 would mean the fourth item in the INP parameter, etc.
If INSTANCE is zero, then the primary input is disabled. You must provide all necessary file size and type parameters to x/ zvopen, since there are no defaults. The history labels also will not be copied, so the current task will be the first (and only) task in the new file's label. This is the primary reason for disabling the primary input.