Framework EDI Reference. Methods and Properties
ediDataElement. Position

Returns the position number of a data element in a data segment; or the position number of a component element  in a composite element.

Syntax:

Remarks:

The position of a data element is its relative position with respect to other data elements in a data segment,  or composite element.  Additional instances of repeating elements have the same position as the first instance of the repeated data element.

Example

Dim oComposite As Fredi.ediDataElement
Dim oAllElements As Fredi.ediDataElements
Dim oDataSegment As Fredi.ediDataSegment
Dim sElements As String
Dim i As Integer

....

' Get first data segment in document.
Set oDataSegment = oEdiDoc.FirstDataSegment

' Get the composite element.
Set oComposite = oDataSegment.GetDataElementByPos("\ISA\GS\ST\PO1\SLN\SLN<C001>")

' Get the object containing the collection of sub elements.
Set oAllElements = oComposite.DataElements

For i = 1 To oAllElements.Count

Dim oSubElement As Fredi.ediDataElement

Set oSubElement = oAllElements.DataElement(i)

' Show element position.
sElements = sElements & oSubElement.Position & vbTab & oSubElement.ID & vbTab & oSubElement.Description & vbCrLf
Next

MsgBox "List of elements: " & vbCrLf & vbCrLf & sElements

 

Sample

P_Position.zip