There is a subtle point not mentioned in the official palm documentation on the format of the PRB/PRC header that I wanted to mention so no one else made my mistake. The documentation at great length explains that in a PRB/PRC, if you have NO RECORDS, then you must add 16-bits of padding after the main header to pad to 32-bit alignment. (The core header is 78 bytes long.) Now, the implicaitons of this are a bit obvious when you actually think about it, but what the documentation does NOT SAY is that even when you DO HAVE records, you must make sure the overall header length including the record index fields (and hence, the start of the first data segment) is also 32-bit aligned. For a record database, the index entries are 8 bytes long, so you ALWAYS have to add 2 bytes of padding after the last index entry. For a resource database, resource index entries are 10 bytes long, so you only add the final 16-bits padding when you have an EVEN number of records. (For an odd number of records, you're safe.) Now, on 16-bit Palms, you won't get a bus error if you missed this, so if you generate your own files without padding you won't crash the system, but in my case, I misread existing files because I didn't account for the final padding. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
