RepeatElement Method

Adds a new repetition to the current element.

Syntax

ANSI (Cross Platform)
int RepeatElement();

Unicode (Windows)
INT RepeatElement();
- (void)repeatElement;
#define MID_EDIFACTWRITER_REPEATELEMENT 13

IPWORKSEDI_EXTERNAL int IPWORKSEDI_CALL IPWorksEDI_EDIFACTWriter_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

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();

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 C++ Edition - Version 20.0 [Build 8203]