Important: The information in this document is obsolete and should not be used for new development.
ZeroScrap
You use theZeroScrap
function to clear the contents of the scrap before writing data to the scrap.
FUNCTION ZeroScrap: LongInt;DESCRIPTION
If the scrap already exists (in memory or on the disk), theZeroScrap
function clears its contents; otherwise,ZeroScrap
initializes the scrap in memory. Whenever your application needs to write data to the scrap as a result of a cut or copy operation by the user, you should callZeroScrap
before callingPutScrap
. Whenever your application needs to write data in one or more formats to the scrap, you should callZeroScrap
before the first time you callPutScrap
.If your application uses
TEToScrap
to write TextEdit's scrap to the scrap, your application should callZeroScrap
to clear the contents of the scrap first. However, note that your application does not have to callZeroScrap
before callingTECut
orTECopy
.The
ZeroScrap
function returns a long integer with the valuenoErr
ifZeroScrap
successfully clears the contents of or initializes the scrap. Otherwise, theZeroScrap
function returns a nonzero value, whose value corresponds to a result code.SPECIAL CONSIDERATIONS
Your application should not call theZeroScrap
function at interrupt time.RESULT CODES
noErr 0 No error ioErr -36 I/O error memFullErr -108 Not enough memory in heap zone