Another way in which prompts and default values can be controlled is by use of the keywords ACCEPT, PROMPT and RESET.
The RESET keyword causes the suggested default value of all parameters (apart from those already specified before it on the command line) to be set to the original values specified by the application or its interface file. In other words global and current values are ignored.
The PROMPT keyword forces a prompt to appear for every application parameter. This can be useful if you cannot remember the name of a defaulted parameter or there would be too much to type on the command line. However, it may prove tedious for certain applications that have tens of parameters, most of which you normally never see. You can abort if it becomes too boring.
The ACCEPT keyword forces the parameter system to accept the suggested default values either for every application parameter if the keyword appears on the command line, or all subsequent parameters if it is supplied to a prompt. In other words, those parameters that would normally be prompted with a value between / / delimiters take the value between those delimiters, e.g. XDIM we saw in parameter defaults would take the value 64. Parameters that are normally defaulted behave as usual. The ACCEPT keyword needs to be used with care in scripts because not every parameter has a default, and therefore must be given on the command line for the application to work properly. For example, CREFRAME must have a value specified for parameter OUT, the name of the output NDF. If we run the application like this:
ICL> creframe accept
it would fail in the sense that it would still have to prompt for a value--it does not know where to write the output NDF. However, if we run CREFRAME like this:
ICL> creframe out=stars accept
it would generate an output image using default values for all the parameters except OUT, and write the output to file stars.sdf. Another point to be wary of is that some applications have loops, e.g. LOOK, LUTABLE, and if you use the ACCEPT keyword it will only operate the first time the application gets a parameter value.
Sometimes the keyword ACCEPT can be used without any parameter value specifications on the command line. For example, we could follow the above command by the command:
ICL> look accept
and the central 7
7 array of the image created by CREFRAME would
be displayed on your terminal without any parameter values being
prompted. The symbol
\ has the same effect as ACCEPT
when used on the command line or at prompts, thus:
ICL> look \
would have the same effect as the previous example--and is quicker to type. In command lines from the shell, the backslash is a metacharacter and has to be escaped. The easiest way to do that is to double the backslash.
% look \\
How do you find out which parameters have suggested defaults, as opposed to those that are normally defaulted? Well, a good rule of thumb is that parameters for output files (images, lookup tables and text) will not have a default, but the remainder will. There are some exceptions, such as where null is the default for optional files. Consulting the description of the parameters should give the suggested defaults, where appropriate. If a parameter is given a suggested default it will have a line beginning ppath or a default line. If you want to use ACCEPT for an automatic procedure or batch job you could do some tests to find which parameters get prompted and then put them on the command line in your procedure.
The RESET and ACCEPT keywords will work in tandem. So for instance,
ICL> look reset accept
will reset the suggested defaults of LOOK to their original, preset values, and accept these as the parameter values.
These special keywords may be abbreviated to no fewer than
two characters, if you have enabled
KAPPA --- Kernel Application Package