Important: The information in this document is obsolete and should not be used for new development.
CloseEdition
Use theCloseEdition
function to close an edition after you finish reading from or writing to it.
FUNCTION CloseEdition (whichEdition: EditionRefNum; successful: Boolean): OSErr;
whichEdition
- The reference number for the edition.
successful
- A value that indicates whether your application was successful (
TRUE
) or unsuccessful (FALSE
) in reading from or writing data to the edition.DESCRIPTION
When a subscriber successfully finishes reading data from the edition, theCloseEdition
function takes the modification date of the edition file that you have read and puts it in themdDate
field of the subscriber's section record. This indicates that the data contained in the edition and the subscriber section within the document are the same.When a subscriber is unsuccessful in reading data from an edition (because there is not enough memory, or you didn't find a format that you can read), set the
successful
parameter toFALSE
. TheCloseEdition
function then closes the edition, but does not set themdDate
field. This implies that the subscriber is not updated with the latest edition.When a publisher successfully finishes writing data to an edition, the
CloseEdition
function makes the data that the publisher has written to the edition available to any subscribers and sets the corresponding edition file's modification date (ioFlMdDat
) to themdDate
field of the publisher's section record. The Edition Manager then sends a Section Read event to all current subscribers set to automatic update mode. At this point, the file type of the edition file is set based on the first known format that the publisher wrote.When a publisher is unsuccessful in writing data to an edition, the
CloseEdition
function discards what the publisher has written to the edition. The data contained in the edition prior to writing remains unchanged, and Section Read events are not sent to subscribers.RESULT CODES
noErr 0 No error ioErr -36 I/O error fnOpnErr -38 File not open rfNumErr -51 Bad edition reference number editionMgrInitErr -450 Manager not initialized SEE ALSO
For an example of the use ofCloseEdition
, see Listing 2-5 beginning on
page 2-36.