IPWorks EDIFACT 2020 Qt Edition

Questions / Feedback?

StartSegment Method

Creates a new EDI data segment on the current document.


int StartSegment(const QString& qsSegmentType);


When called, a new data segment is created in the current transaction and set as the current segment. You can then set the values on said segment. Creating a new data segment automatically writes the previous current segment to the output stream.

The SegmentType argument specifies the type of data segment to create, using an XPath-like syntax, based on the transaction set schema. For example, to create a new N1 segment on the first N1 loop, specify "/N1Loop1/N1".

It's important to realize that segments must be created in the same order they should appear on the target EDI document. The EDIWriter component doesn't automatically enforce ordering rules, nor does it force the document to reorder segments in loops automatically.

Error Handling

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 EDIFACT 2020 Qt Edition - Version 20.0 [Build 8209]