NewSection
initalMode, sectionH );
FSSpec *sectionDocument ; contains the volume reference number, directory ID, and
filename
long sectionID ; is a unique number for a
section within a document
UpdateMode initalMode ; contains the update mode for the section.
record or NIL
You use the NewSection function to create a new section (either publisher or subscriber) and alias record (which is a reference to the edition container
from the document containing the publisher or subscriber section). The
NewSection function allocates two handles in the current zone: one handle for the section record and another handle for the alias record. Note that you are
container specifies the edition you want to publish or subscribe to.
sectionDocument contains the volume reference number, directory ID, and filename
of the document that contains a section. The sectionDocument
parameter can be NIL if your current document has never been saved.
If so, when the user finally saves the document, remember to call the
alias record.
kind designates the type of section (publisher or subscriber) being
created.
sectionID s a unique number for a section within a document. The sectionID
parameter initializes the sectionID field within the new section
record. Do not use 0 or -1 for an ID number; these numbers are
reserved. If your application copies a section, you need to specify a
unique number for the copied section.
initalMode contains the update mode for the section. For publishers this is
either the pumOnSave or pumManual constant, and for subscribers it
is either sumAutomatic or sumManual. A subscriber created with
sumAutomatic mode automatically receives a Section Read event. To
prevent this initial Section Read event, you should set the initialMode
parameter to sumManual and then, when NewSection returns, set the mode field of the section record to sumAutomatic.
sectionH If the NewSection function fails, the sectionH parameter is set to NIL. If the function is successful, sectionH contains the handle to the
allocated section record.
noErr (0) No error
editionMgrInitErr (-450) Manager not initialized
badSectionErr (-451) Not a valid section type
badSubPartErr (-454) Bad edition container spec
multiplePublisherWrn (-460) Already is a publisher
notThePublisherWrn (-463) Not the publisher
Notes: Your application receives the multiplePublisherWrn result code if there
is another registered publisher to the same edition. Your application
receives the notThePublisherWrn result code if another publisher (to the
same edition) was the last section to write to the edition. The
multiplePublisherWrn result code takes priority over the
notThePublisherWrn result code.
The NewSection function registers a section similar to the way that the (except that the NewSection function does not resolve an alias to find the edition container).