At 01:24 PM 3/6/2004, you wrote:
Hi every body,

Is it possible to change a global data (like an array) that is compiled in to a .PRC file without re-compiling the program with CodeWarrior?
Suppose that we have a program that is dependent on data that could be re-defined by user, how can user supply the program with new data without CodeWarrior, I remember that if I compiled a program having a global array with Borland C 3.1 I was able to see the same data that is used to initialize the array somewhere in the out put EXE file


for example the following definition :

static unsigned char data[10] = {1,2,3,4,5,6,7,8,9,0};

will result numbers 1-0 to be placed in to EXE keeping the same sequence

but I can not find that sequence in a PRC file when I use the same array definition

You won't find that sequence in your binary, as CW emits a compressed data section that gets rebuilt at runtime.


If you want a replacable array, you should put the data into a resource and alter that. You can lock a resource to get a pointer to it and use it as a read-only data item at runtime fairly easily.

-- Ben Combee, senior DTS engineer, PalmSource, Inc.
   Read "Combee on Palm OS" at http://palmos.combee.net/



--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to