[comp.sys.mac.programmer] Including DLOG and DITL resources with new ID's

leeke@m2.csc.ti.com (Steve Leeke) (01/13/90)

I would like to be able to include some resources from a number of
other files into the final resource file for my program, changing the
included resources' IDs in the process.  I'm using Rez so this is
pretty easy.  I'm using:

include "foo" 'DITL' (128:999) as 'DITL' (ResourceOffset + $$ID);
include "foo" 'DLOG' (128:999) AS 'DLOG' (ResourceOffset + $$ID);

The problem arises in the DLOG resources since they also include a
reference to the DITL to use - whose resource ID just changed.  Since
the ResourceOffset will change over time I'd like to figure out an
automated way to update the DLOG resource using MPW tools and scripts.

Any ideas?

Thanks,

Steve Leeke
leeke@csc.ti.com

TI Computer Science Center
Dallas, TX 75265
(214) 995-0397

beard@ux1.lbl.gov (Patrick C Beard) (01/13/90)

In article <105612@ti-csl.csc.ti.com> leeke@m2.csc.ti.com (Steve Leeke) writes:
#I would like to be able to include some resources from a number of
#other files into the final resource file for my program, changing the
#included resources' IDs in the process.  I'm using Rez so this is
#pretty easy.  I'm using:
#
#include "foo" 'DITL' (128:999) as 'DITL' (ResourceOffset + $$ID);
#include "foo" 'DLOG' (128:999) AS 'DLOG' (ResourceOffset + $$ID);
#
#The problem arises in the DLOG resources since they also include a
#reference to the DITL to use - whose resource ID just changed.  Since
#the ResourceOffset will change over time I'd like to figure out an
#automated way to update the DLOG resource using MPW tools and scripts.
#
#Any ideas?
#

This might seem obvious, but it seems to me that this is a perfect
candidate for a resource that you should implement in the Rez language
itself.  Then you can specify in the text of the Rez source file how
the DLOG's and DITL's relate.  The best place to start would be to
DeRez your resource files and add the symbolic constants.  You could
still keep them as separate files if you like, and use the #include
directive instead.


-------------------------------------------------------------------------------
-  Patrick Beard, Macintosh Programmer                        (beard@lbl.gov) -
-  Berkeley Systems, Inc.  ".......<dead air>.......Good day!" - Paul Harvey  -
-------------------------------------------------------------------------------