Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: More Macintosh Toolbox /
Chapter 2 - Scrap Manager / Scrap Manager Reference
Routines / Writing Information to the Scrap


ZeroScrap

You use the ZeroScrap 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), the ZeroScrap 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 call ZeroScrap before calling PutScrap. Whenever your application needs to write data in one or more formats to the scrap, you should call ZeroScrap before the first time you call PutScrap.

If your application uses TEToScrap to write TextEdit's scrap to the scrap, your application should call ZeroScrap to clear the contents of the scrap first. However, note that your application does not have to call ZeroScrap before calling TECut or TECopy.

The ZeroScrap function returns a long integer with the value noErr if ZeroScrap successfully clears the contents of or initializes the scrap. Otherwise, the ZeroScrap function returns a nonzero value, whose value corresponds to a result code.

SPECIAL CONSIDERATIONS
Your application should not call the ZeroScrap function at interrupt time.

RESULT CODES
noErr0No error
ioErr-36I/O error
memFullErr-108Not enough memory in heap zone

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996