I get an error in PalmOS emulator:
<PROGRAM>(1.0) just read from memory location
0x<VALUE>, causing a bus error
when i compile and execute this piece of code (Please
add empty StopApplication function, an alert resource
and empty eventloop) :
static Err StartApplication()
{
const char *TESTARRAY[20] = {
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t"};
FrmCustomAlert(<ALERT RESOURCE NUMBER>, TESTARRAY[0],
"test", "");
return 0;
}
UInt32 PilotMain(UInt16 launchCode, MemPtr cmdPBP,
UInt16 launchFlags)
{
Err err = 0;
if\(launchCode == sysAppLaunchCmdNormalLaunch\)
\{
gbExit = false;
if \(\(err = StartApplication\(\)\) == 0\)
\{
EventLoop\(\);
err = iLastError;
\}
StopApplication\(\);
\}
return err;
}
It seems as long as the array "TESTARRAY" isn't larger
than 14 or so elements everything is O.K. However, when
it gets bigger the above mentioned occures or sometimes
it's an illegal operation error, depending on where i
put the offending code.
Logged In: NO
I have experienced lots of problems with large const arrays.
So far, I could always get things to work by removing the
"const".