"Paul Nevai" <[EMAIL PROTECTED]> wrote in message
news:58965@palm-dev-forum...
>
> I have these things in my [Mac based] CW project.
>
> #define stringRsrc 'tSTR'
> type stringRsrc {align word; cstring;};
> read stringRsrc (2000) "Help_x";
>
> Here "Help_x" is a MetroWerks text file saved in a Mac format [I tried
unix
> and DOS formats too].
>
> When it gets into the .prc file after a CW job, it is not a '\0'
terminated
> string. How can I make it '\0' terminated?
>
> It seems that the CW editor does not save the file with '\0'
termination.
Why would you add a NUL byte to the end of a text file on disc?
This is very easy to solve -- change your definition to explicitly
include the trailing NUL character.
#define stringRsrc 'tSTR'
type stringRsrc {align word; cstring; byte = 0;};
resource stringRsrc (2000) { $$read("Help_x") }
using the "read" keyword ignores an established resource type, whereas
$$read inserts a file into the resource you're currently defining.
See Apple's Rez documentation at
ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_etc./Docu
mentation/MPW_Reference/Building_Progs_In_MPW.sit.hqx
It extracts to a PDF file (though Windows users will need to use Aladdin
Extractor and rename the final file to have a .pdf extension).
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/