Home Forums General XMetaL Discussion How to share macro code between projects? Reply To: How to share macro code between projects?


Reply to: How to share macro code between projects?

Thank you for your helpful answer. In fact I had overlooked that in the “Add existing item…” dialog box the “Add” button gives you the choice of referencing an item instead of copying it. (You may admit that this is not quite obvious, so it would make sense to document this fact.)

Some points, however, have to be added:

  • While it is possible to add a single (isolated) script file by reference, the same is not possible for a macro script (i.e. one that is to be integrated in the MCR file). This looks to me like an oversight.
  • Fortunately, there is a workaround: If you edit the XDP file manually, changing the name of a script file to a fully qualified path name and changing ProjRelPath from T to F (this is what the “Add as link” button does in the case of non-macro script files), everything works like it should.

(By the way, it is not very robust that shared files can only be referenced by absolute path names because it makes it impossible to checkout a project to an arbitrary location from the source code repository. I don't know whether this is a limitation of MS Visual Studio or of XmetaL Developer.)