I am having a problem understanding how to read and write
a MemoPad record.
I have looked at MemoPad application but is not really helping
me on this. I have three problems (probably more).
Problem 1: I have placed a Custom Alert to tell me how many
records are in the DB. The popup reports 535 records. But
there are only 144 records. I have verified the real number of
records by the count in MemoPad and by looking at the DB with
RsrcEdit app. Both show 144 records. Why the discrepancy?
Problem 2: I get a fatal error when I use this code. I have
removed everything down to the bare minimum that causes the
crash. The problem is with what is inside the 'for' block. I
use this code to access another of my own DBs. What is wrong
with this code? Why does it crash?
Problem 3: I have looked at the MemoDB with RsrcEdit and it is
just a null terminated string for each record. Doesn't RecPointer
point to the first char of the MemoPad data? If not, what is the
format of the record pointed to by RecPointer?
Where is the best source of documentation on a MemoPad record?
A simple app would help.
Thanks
void GetImportNames(void) {
VoidHand RecHandle;
Ptr RecPointer;
int i, numRecs;
char buffer[10];
numRecs = DmNumRecords(ImportDB);
StrIToA(buffer, numRecs);
FrmCustomAlert(altNotice, buffer, "", "");
for(i=0; i<numRecs; i++) { // get names
RecHandle = DmQueryRecord(ImportDB, i);
RecPointer = MemHandleLock(RecHandle);
// Do something here
// to access specific data
MemPtrUnlock(RecPointer);
}
}
--
-----------------------------------------------------------------
Discussion Group: http://www.halcyon.com/ipscone/wwwboard/
Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------