I wonder if I am alone and if I am overdoing it when I use the
ErrFatalDisplayIf () stuff below. Would most professionals simply go ahead
w/o any error checking? Is there a gentler way of doing the error checking?
Simply terminating the procedure would not be an alternative in this case so
that "if (!myStrH) {return;}" is not acceptable. Adding clean-up code would
significantly increase the size of the code. Any opinions? Best regards, Paul
FieldPtr fldP;
MemHandle myStrH = NULL;
Char * myStrP = NULL;
UInt16 myStrPLength;
...
myStrH = ClipboardGetItem (clipboardText, &myStrPLength);
ErrFatalDisplayIf (!myStrH, "H: Bad ClipBoard");
myStrP = MemHandleLock (myStrH);
ErrFatalDisplayIf (!myStrP, "P: Bad ClipBoard");
FldInsert (fldP, myStrP, myStrPLength);
MemHandleUnlock (myStrH);
...
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/