To find out if a database is in ROM or RAM, here's a chunk of code: (this code
is under the GPL, so learn from it, don't copy and paste.)
From FileCaddy (filecaddy.sourceforge.net) Src/Utility.c:130
// Function: isROMDB
// Description: Check to see if the database is in ROM, instead of RAM.
// Arguments: UInt16 card - Which memory card is the database on?
// LocalID lid - What is the local ID for the database?
// Returns: Boolean - True - The database -is- in ROM.
// False - The database is -not- in ROM.
// The database may not even be in RAM...
Boolean isROMDB ( UInt16 card, LocalID lid ) {
void *phan;
unsigned short heapid;
phan = MemLocalIDToGlobal(lid, card);
if (MemLocalIDKind(lid) == memIDHandle)
heapid = MemHandleHeapID(phan);
else
heapid = MemPtrHeapID(phan);
if (MemHeapFlags(heapid) & 0x0001) /* memHeapFlagReadOnly */
return true;
else
return false;
}
--
Matthew (Darkstorm) Bevan [EMAIL PROTECTED]
Margin Software, NECTI. http://www.marginsoftware.com
Re-inventing the wheel, every time.
- It's illegal in Wilbur, Washington, to ride an ugly horse.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/