next up previous 204
Next: Names
Up: Examples of Possible User Responses
Previous: Indirection.

Modification.

As an example of the use of ``modification'', let's suppose that the user responds to the prompt for OUT_FILES with the string:

      A_*2|RAW|FLAT|

This would cause the application to generate six strings, based on the six strings held in the first group (see programming note [*]). The names are generated as follows

  1. First, a copy of the six names in the first group is made and stored in the second group.
  2. Next, any occurrence of the string ``RAW'' within any of these names is replaced with the string ``FLAT''. This leaves the second group holding the names:

          IC_1575_FLAT
          IC_4320_FLAT
          NGC_5128_FLAT
          NGC_2534_FLAT
          NGC_1947_FLAT
          NGC_3302_FLAT
    

  3. Next, each name is substituted in turn for the ``$*$'' character in the string to the left of the first ``$\mid$'' character. Thus each name is prefixed by ``A_'' and suffixed by ``2''. The second group finally holds the names:

          A_IC_1575_FLAT2
          A_IC_4320_FLAT2
          A_NGC_5128_FLAT2
          A_NGC_2534_FLAT2
          A_NGC_1947_FLAT2
          A_NGC_3302_FLAT2
    

Modification can be combined with indirection and/or the specification of literal strings. For instance, the user could have replied to the prompt for OUT_FILES with the string:

      NEW_FILE,A_*2|RAW|FLAT|,^LIST.DAT

This would have caused the second group to contain not only the six names described above, but also the additional names NEW_FILE and any names read from the text file LIST.DAT. In this case, the number of output files would have exceeded the number of input files and the check described in programming note [*] would fail.


next up previous 204
Next: Names
Up: Examples of Possible User Responses
Previous: Indirection.

GRP Routines for Managing Groups of Objects
Starlink User Note 150
D.S. Berry
21st October 2009
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council