Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-2341

Provide the ability to include the contents of one script within another

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • None
    • Scripting
    • None

      Consider adding a function (e.g. $include()) to allow including the contents of one script within another, similar to the #include statement in C/C++.  A possible use case for this would be:

      If you have separate scripts for Classical and everything else, much of the code identifying the various elements used for naming (artist name format, numbering, etc) are the same, just rearranged differently for the final output. The common code could be maintained in one place. Currently it's copy'n'paste between scripts.

      You might have 3 scripts: "Classical", "Other" and "Common". Both Classical and Other would have a line like $include(Common) at or near the top of the script, and then just arrange the values set in the Common script as required.  The "Common" script would never actually be used by itself as a naming script.

      Things to consider:

      • How to handle the case if the included script is not found.  (Log an error and proceed as it it was empty?)
      • How to handle nested includes.
      • How to handle infinite loops in nested includes or a script including itself.  (Do includes need to be tracked and only included once?)

       

            Unassigned Unassigned
            rdswift Bob Swift
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Version Package