Framework EDI Reference. Methods and Properties
ediDataSegment. Area

Returns the area number of the data segment.

Syntax:

Remarks:

Area numbers are relevant only within the context of a transaction set/message of an EDI document.

All data segments within a transaction set/messate are divided into discrete areas represented by numbers 1 or greater.  All data segment that fall outside the transaction set/message (e.g. control segments ISA, GS, etc.) have an area number of zero.

Commonly, the transaction set/message is divided into 3 areas: the header, the detail and the summary area, which are numerically represented as 1, 2 and 3 respectively.  Not all documents have all three sectioned areas.  If there is only one area in the transaction set/message then all data segments are defined under area 1.

Note that a data segment in a transaction set/message can be uniquely identified by its Area, LoopSection and its segment ID properties.

 

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oSegment As Fredi.ediDataSegment
...

Set oSegment = oEdiDoc.FirstDataSegment
While Not oSegment Is Nothing
    sSegmentID = oSegment.ID
    sLoopSection = oSegment.LoopSection
    nArea = oSegment.Area

    If nArea = 2 Then
        If sLoopSection = "LX;N1" Then
            If sSegmentID = "N1" Then
                txtCompanyName.Text = oSegment.DataElementValue(2)
                txtCompanyID.Text = oSegment.DataElementValue(4)
            End If
        End If
    ElseIf nArea = 3 Then
        If sLoopSection = "" Then
            If sSegmentID = "BIN" Then
                Set oDataElement = oSegment.DataElement(2)
                oDataElement.ExportValue sPath & "EXported" & txtPublicKey.Text
            ElseIf sSegmentID = "ERI" Then
                txtMethodSend.Text = oSegment.DataElementValue(2)
            End If
        End If
    End If
    Set oSegment = oSegment.Next
Wend

Sample

Visual Basic program displaying Data Segment properties