Luc Le Blanc wrote:
Neil Whitworth a écrit :
Luc Le Blanc wrote:
I need to store a table of geodesic datum conversion factors (about
300 doubles.) If I put it in my code as a const struct, does it eat
up my heap? Or should I instead put the data into an auxiliary PDB I
can read only when I need to access the specific data I need?
Luc Le Blanc
You could alsow save the data as a resource in you app prc. I believe
there is also a 'integer array' resource type.
At least Constructor doesn't know about this resource type.
If PalmOS resources emulate the MacOS' you should be able to create
your own resource types and even provide a template for editing
(by ResEdit.) But my MacOS days are long gone and I don't if this
brilliant idea still works.
My arrays are a little more complex than just integers:
typedef struct
{
double radius;
double flattening;
} Ellipsoid;
typedef struct
{
Char name[ DatumNameLength ];
UInt16 ellipsoid;
float dX, dY, dZ;
} Datum;
you can do the following using prc-tools (perhaps there are similar
tools for codewarrior as well)
data.c:
struct Something[] data={"any data here", 123, 456.01, ....};
data.rcp:
DATA "data" ID 1 "data.bin"
gcc -c -o data.o data.c
objcopy -O binary data.o data.bin
pilrc -ro -o data.prc data.rcp
and then:
MemHandle h=DmGetResource('data',1);
struct Something* data=(struct Something*)MemHandleLock(h);
it is not as convenient as it should be, but at least you still have all
your data in the regular .c file.
good luck :)
sz.
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/