Important: The information in this document is obsolete and should not be used for new development.
The Scrap Information Record
The Scrap Manager returns information about the scrap in a scrap information record. The scrap information record is defined by theScrapStuff
data type.
TYPE ScrapStuff = {scrap information record} RECORD scrapSize: LongInt; {size (in bytes) of scrap} scrapHandle: Handle; {handle to scrap} scrapCount: Integer; {indicates whether the contents } { of the scrap have changed} scrapState: Integer; {indicates state and location } { of scrap} scrapName: StringPtr; {filename of the scrap} END; PScrapStuff = ^ScrapStuff; {pointer to scrap info record}
Field Description
scrapSize
- The size of the scrap in bytes.
scrapHandle
- A handle to the scrap if it's in memory; otherwise, this field is
NIL
.scrapCount
- A number that changes each time your application (or another application) calls the
ZeroScrap
function. When your application receives a suspend event, it should copy any data from its private scrap to the scrap and it can save the value of thescrapCount
field. Upon receiving a resume event, your application can use theInfoScrap
function to examine the current value of thescrapCount
field. If the value in thescrapCount
field is different from the previous value, the contents of the scrap have changed and your application should copy the data from the scrap to its private scrap.- Alternatively, rather than saving and examining the value of the
scrapCount
field, your application can check theconvertClipboardFlag
bit of the event record for a resume event. If this bit is set, the contents of the scrap have changed and your application should take the appropriate actions.scrapState
- The location and state of the scrap. This field is positive if the scrap data is in memory, 0 if the scrap data is on the disk, or negative if the scrap hasn't been initialized.
- Note
- In unusual circumstances the value of
scrapState
might be 0 when the scrap is actually in memory. This can occur if the user deletes the scrap file on disk and then performs a cut or copy operation.scrapName
- The filename of the scrap when the scrap is stored on disk. Usually the scrap file is named "Clipboard". The scrap file is always stored on the startup volume.