Path: utzoo!mnetor!uunet!wucs1!wuphys!mrk From: mrk@wuphys.UUCP (Mark R. Kaufmann) Newsgroups: comp.sys.mac.programmer Subject: Re: documenting resources Message-ID: <542@wuphys.UUCP> Date: 29 Apr 88 15:16:02 GMT Reply-To: mrk@wuphys.UUCP (Mark R. Kaufmann) Organization: Dept. of Physics, Washington Univ., St. Louis Lines: 64 Summary: summary of replies A couple of weeks ago (<534@wuphys.UUCP>), I asked the following question of the net: How does one document the resource "code" that is "written" using ResEdit? The responses kept trickling in, and this article attempts to summarize all of those responses. (Sorry it has taken so long.) Thanks to all of you who replied; I have not included your names here. ------------------------ There are several resource-decompilers available; they eat a resource file and spit out ASCII text which is suitable for input into one of the standard resource-compilers. In particular: MPW (Macintosh Programmers Workshop) includes a pair of tools called a resource compiler and resource decompiler. They've defined a textual specification language for describing resource contents; the compiler (Rez) converts text files to resources; the decompiler (DeRez) converts resource files to Rez source format. You can build resources using ResEdit or whatever, then use the decompiler to make a textual equivalent for documentation purposes, including hard copy. Some resources simply become hex dumps, but others are converted into a more readable form. You can create you own templates (using a language similar to C) for the DeRez'ing so you can get something more intelligable than a straight hex dump. Both formatted and unformatted (hex dump) forms are accepted by Rez to create a resource file. The formatted version requires the templates which are included with MPW. The templates include most all resources (DITL, DLOG, STR , WIND, vers, SIZE, etc.). [MPW is available from APDA, 290 SW 43rd Street, Renton, WA 98055, USA. Disclaimer: I have no connection with APDA at all!] ------------------------ There are also PD/shareware resource compilers & decompilers. Try looking in the SUMEX archives for names like "DeRez", "ResTools", etc. I believe there is a public domain/shareware program (ResDecomp?) to convert resources into a textual form that would be accepted by RMaker, which other development systems use to compile resources. ------------------------ One person says: However, most people I know have never felt the need for hard copy of resource files. I just build them as I need them and keep plenty of backups in case ResEdit turns around and bites me. Someone else: I don't find myself documenting resources for archival purposes. Maybe for describing them to others....(writing an article?) ------------------------ One person, oster%SOE.Berkeley.EDU@jade.berkeley.edu (David Phillip Oster) asks: Does anyone know if there is any facility like '#define' in Rez? It would be useful for example, to define a grid of editable text items, and have their size contained in a single '#define'. ================================ Mark R. Kaufmann UUCP: ...!ihnp4!wuphys!mrk ...!uunet!wucs1!wuphys!mrk Internet: mrk@wuphys.wustl.edu ================================