IPWorks EDIFACT 2020 JavaScript Edition

Questions / Feedback?

RepeatElement Method

Adds a new repetition to the current element.

Syntax

edifactwriter.repeatElement(): void

Remarks

RepeatElement is used to write repeated data elements in supporting version of X12 or EDIFACT. To use it, first write the first repetition of the simple or composite data element and then call RepeatElement to repeat it, then write again.

Example: Repeating a simple data element:

  EDIWriter writer = new EDIWriter();
  ...
  writer.StartSegment("Tag");
  ...
  writer.WriteElementString("R1_1");
  writer.RepeatElement();
  writer.WriteElementString("R1_2");
  writer.RepeatElement();
  writer.WriteElementString("R1_3");
  ...
  writer.EndSegment();

Example: Repeating a composite data element:

  EDIWriter writer = new EDIWriter();
  ...
  writer.StartSegment("Tag");
  ...
  writer.StartElement();
  writer.WriteComponentString("C1_1");
  writer.WriteComponentString("C2_1");
  writer.RepeatElement();
  writer.WriteComponentString("C1_2");
  writer.WriteComponentString("C2_2");
  writer.RepeatElement();
  writer.WriteComponentString("C1_3");
  writer.EndElement();
  ...
  writer.EndSegment();

 
 
Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks EDIFACT 2020 JavaScript Edition - Version 20.0 [Build 7721]