> 
> POSE Error: "...directly read from data manager data structure.."
> 
> Is this really a no-no?  POSE identifies this as an error and I'm trying
> to find the source.
>
> I have some code that gets Names from DB Records as follows:
>
> for(i=0; i<numRecs; i++) {
>     RecHandle = DmQueryRecord(MyDB, i);
>     RecPointer = MemHandleLock(RecHandle);
>     StrCopy(NameArray[i], RecPointer + 2);  // name starts at +2
>     MemPtrUnlock(RecPointer);
> }
>
> First, would this generate _that_ error?
>
> And second, is this a no-no?  Why is that a no-no, if it is?
>
    Is it possible that the string pointed to by RecPointer is not
null-terminated?  This would cause StrCopy to traipse off the end of the
record and into the next record header, triggering a datamgr read error..
Or, perhaps the record pointed to by RecPtr isn't even 3 chars long?




--
Dan Rowley
Innovative Computer Solutions
Developers of fine software for Newton, Windows CE, Palm Computing Platform,
Windows, and MacOS

Reply via email to