[Pythonmac-SIG] Read Strings from Resources

wicked witch wicked-witch at gmx.net
Wed Dec 22 20:25:45 CET 2004


Opstad, Dave schrieb:
> On 12/22/04 1:51 AM, "Jack Jansen" <Jack.Jansen at cwi.nl> wrote:
> 
> 
>>On 22 Dec 2004, at 00:22, Opstad, Dave wrote:
>>
>>
>>>According to MacTypes.r (in the last Universal Headers revision), the
>>>Rez format for a 'STR#' resource is as follows:
>>>
>>>--------------------
>>>type 'STR#' {
>>>   integer = $$Countof(StringArray);
>>>   array StringArray {
>>>      pstring;   /* String */
>>>   };
>>>};
>>>--------------------
>>>
>>>So it looks like a 2-byte count followed by an array of Pascal strings.
>>
>>Ah yes. And now that I see this I seem to remember that the pstrings
>>are padded to a 2-byte boundary.
> 
> 
> Hmmm, I'd be a bit surprised if there was such alignment padding. Pascal
> string lengths are one byte, so after the single integer listed above
> everything else should just be byte-aligned.
> 
yeah you are right. Still it would be much easier with the GetIndString 
method. Thx for your help. I implemented it in c++ this time(was just a 
litle tool).
thx Zee


More information about the Pythonmac-SIG mailing list