[comp.sys.mac.programmer] ResEdit TMPLs

hammersslammers1@oxy.edu (David J. Harr) (08/11/90)

I am trying to create a template for a custom resource in ResEdit. Since I
was too cheap to buy the thing from APDA ("Money? What do you mean spend
money? I pirated this fair ands square...") I find now that I am being bit
 by not understanding the size of the various parameters in the TMPL TMPL.
There are several different sizes, including
HWRD (half word = 1 byte?)
LONG (long = 4 bytes?)
LSTE (not a clue)
DWRD (double word? but that would be the same as a long, right?)
LSTC (again, not a clue)
ZCNT (a zero count, ie you take the number and add one to it)
HLNG (half long = 2 bytes? but that is the same as a word, right?)
LSTB (not a clue)
FWRD (full word = 2 bytes?)
BBIT (I dunno)
DLNG (double long = 8 bytes?)
ESTR (dunno)

Anyone who could explain the arcane terminology here (shades of Un*x!) would
be halping a poor confused programmer to help resist the temptation to throw
himself off the nearest edifice of more than 17 stories so as to put an end
to his misery in this vale of tears. Seriously, if there is a place where I
can get this information from FTP or whatever, point me tooit, and I will
shut up and cease pestering my betters. Does the ResEdit tutorial 3.0 that
someone posted a while back have information about creating custom templates
for custom resources? Thanks mucho.

David

jason@ux1.cso.uiuc.edu (char *myName) (09/29/90)

hammersslammers1@oxy.edu (David J. Harr) writes:

>I am trying to create a template for a custom resource in ResEdit. Since I
>was too cheap to buy the thing from APDA ("Money? What do you mean spend
>money? I pirated this fair ands square...") I find now that I am being bit
> by not understanding the size of the various parameters in the TMPL TMPL.
>There are several different sizes, including

>HWRD (half word = 1 byte?)
	Hex word: 2 bytes

>DWRD (double word? but that would be the same as a long, right?)
	Decimal word: 2 bytes

>ZCNT (a zero count, ie you take the number and add one to it)
	I think this refers to a zero-based counting scheme used with
certain list structures.  For instance, color tables have a word which is
one less than the number of entries in the table.

>HLNG (half long = 2 bytes? but that is the same as a word, right?)
	Hex long: 4 bytes

>FWRD (full word = 2 bytes?)
	Filler word: 2 bytes.  Two null bytes are inserted into the
resource structure, but an editable field does not appear where FWRD was
used.

>BBIT (I dunno)
	Boolean Bit?  Binary Bit?  I think this takes up one bit of a
word-sized object (or perhaps a byte-sized object) similar to

struct	{
	   Boolean   aBit : 1
	}...

>DLNG (double long = 8 bytes?)
	Decimal long: 4 bytes

>ESTR (dunno)
	Me either.  I suspect it is a type of string.  Pascal strings (PSTR)
will begin with a length byte.  C-style null-terminated strings (CSTR) will
end with a zero-byte.  Perhaps ESTRs are simply an alternative format for
strings ("empty" string, perhaps, as a single byte filler).

LST*s are used to create list structures of dynamic size.

Note: this information is free but may not be worth the price.  I too have
      not purchased the APDA materials.  This knowledge comes from my own
      hacking with TMPLs.
-- 

                       |  |    |====================|
                       |  |    | Jason Watts        |
                     \ |\ |\ \ | (jazzin@uiuc.edu)  |