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: Interapplication Communication /
Chapter 2 - Edition Manager / Edition Manager Reference
Data Structures


The Section Record

A section record identifies a specific publisher or subscriber section. It contains information to identify the section as a publisher or a subscriber, a time stamp to record the last modification of the section, and unique identification for each section. Many Edition Manager routines require a handle to a section record as a parameter. The SectionRecord data type defines a section record.

TYPE SectionRecord = 
   RECORD
      version:       SignedByte;    {always 1 in 7.0}
      kind:          SectionType;   {publisher or subscriber}
      mode:          UpdateMode;    {automatic or manual}
      mdDate:        TimeStamp;     {last change in document}
      sectionID:     LongInt;       {application-specific, }
                                    { unique per document}
      refCon:        LongInt;       {application-specific}
      alias:         AliasHandle;   {handle to alias record}

      {The following fields are private and are set up by the }
      { RegisterSection function. Do not modify the private }
      { fields.}
      subPart:       LongInt;       {private}
      nextSection:   SectionHandle; {private, do not use as a }
                                    { linked list}
      controlBlock:  Handle;        {may be used for comparison }
                                    { only}
      refNum:        EditionRefNum; {private}
END;
Field Description
version
Indicates the version of the section record, currently $01.
kind
Defines the section type as either publisher or subscriber with the stPublisher or stSubscriber constant.
mode
Indicates if editions are updated automatically or manually.
mdDate
Indicates which version (modification date) of the section's contents is contained within the publisher or subscriber. The mdDate field is set to 0 when you create a new subscriber section and to the current time when you create a new publisher. Be sure to update this field each time publisher data is modified. The section's modification date is compared to the edition's modification date to determine whether the section and the edition contain the same data. The section modification date is displayed in the publisher and subscriber options dialog boxes. See "Closing an Edition" on page 2-28 for detailed information.
sectionID
Provides a unique number for each section within a document. A simple way to implement this is to create a counter for each document that is saved to disk with the document. The counter should start at 1. The section ID is currently used as a tie breaker in the GoToPublisherSection function when there are multiple publishers to the same edition in a single document. The section ID should not be 0 or -1. See "Duplicating Publishers and Subscribers" on page 2-58 for information on multiple publishers.
refCon
Reference constant available for application-specific use.
alias
Contains a handle to the alias record for a particular section within a document.
Whenever the user creates a publisher or subscriber, call the NewSection function (described on page 2-75) to create a section record and alias record.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996