Important: The information in this document is obsolete and should not be used for new development.
ZeroScrap
You use theZeroScrapfunction 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), theZeroScrapfunction clears its contents; otherwise,ZeroScrapinitializes 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 callZeroScrapbefore callingPutScrap. Whenever your application needs to write data in one or more formats to the scrap, you should callZeroScrapbefore the first time you callPutScrap.If your application uses
TEToScrapto write TextEdit's scrap to the scrap, your application should callZeroScrapto clear the contents of the scrap first. However, note that your application does not have to callZeroScrapbefore callingTECutorTECopy.The
ZeroScrapfunction returns a long integer with the valuenoErrifZeroScrapsuccessfully clears the contents of or initializes the scrap. Otherwise, theZeroScrapfunction returns a nonzero value, whose value corresponds to a result code.SPECIAL CONSIDERATIONS
Your application should not call theZeroScrapfunction at interrupt time.RESULT CODES
noErr 0 No error ioErr -36 I/O error memFullErr -108 Not enough memory in heap zone