next up previous 530
Next: Introducing a Pause Between Invocations
Up: Processing Groups of Data Files
Previous: What Happens if an Error Occurs?

What about Applications that Re-use Parameters?

Some applications use a single parameter to obtain a series of values from the user. Examples are the INIT parameter of CENTROID and the OPTION parameter of SETEXT. Remembering that parameters that are not associated with either an NDF or a positions list retain their values between invocations, it is not surprising that care is needed when using such application to process groups of NDFs. For instance, when using CENTROID you supply a null parameter value (i.e. a single exclamation mark !) as the final value for the INIT parameter to indicate that you do not wish to find any more centroids. Since parameter values are retained between invocations when processing groups of NDFs, this null value becomes the first value to be used by any subsequent invocation. The next invocation of CENTROID finds INIT set to a null value, assumes that no more centroids are to be found, and exits immediately! The same goes for all subsequent invocations until the group of NDFs has been exhausted.

The only way (currently) to avoid this behaviour is to specify the INIT parameter value on the command line. CENTROID takes this as an indication that you only want to find a single centroid, and so does not attempt to get a new value for INIT, thus leaving the supplied value for the next invocation. The same value for INIT is thus used by all invocations. Of course, this means you can only find a single centroid in each NDF.25

Most applications that re-use one or more parameters during a single invocation have some similar means of indicating that you do not want to be prompted for a new value. For some (like CENTROID), putting the parameter value on the command line accomplishes this. Some others (such as SETEXT) have a LOOP parameter that can be set FALSE to indicate that parameters should not be accessed more than once. The reference documentation for each command should be consulted for details.


next up previous 530
Next: Introducing a Pause Between Invocations
Up: Processing Groups of Data Files
Previous: What Happens if an Error Occurs?

KAPPA --- Kernel Application Package
Starlink User Note 95
Malcolm J. Currie & David S. Berry
2013 February 14
E-mail:starlink@jiscmail.ac.uk

Copyright © 2013 Science and Technology Facilities Council