EDIFACTWriter Control

Properties   Methods   Events   Config Settings   Errors  

The EDIFACTWriter control generates EDIFACT documents with a clear, straightforward API.

Syntax

EDIFACTWriter

Remarks

The control allows you to create an EDI document from scratch, one segment at a time. Here's how a document would normally be created:

  1. Call LoadSchema to load the necessary schemas for the transactions that will be used.
  2. Specify where to write the output document by setting the OutputFile, or check the OutputData property after writing.
  3. Create a new interchange start segment by setting the fields of the Interchange property and call the StartInterchange method. Once the interchange is complete, call EndInterchange to add the interchange footer.
  4. If you want to create a functional group, set the fields of the FunctionalGroup property and then call the StartFunctionalGroup. Once all the messages in the group have been created, call EndFunctionalGroup to add a footer for the group.
  5. To start a message, call the StartMessage method. Once all segments have been added, call EndMessage to add a footer to the message.
  6. To begin a segment, call the StartSegment method and pass in the tag for the segment. Once all the elements in the segment have been added, call EndSegment to add the segment terminator.
  7. To write a basic element to the current segment, call the WriteElement method.
  8. To write a composite element, call the StartCompositeElement method, then call the WriteComponent method for each component, and finally call EndCompositeElement to end the element.

Property List


The following is the full list of the properties of the control with short descriptions. Click on the links for further details.

DelimiterComponentThe character used to separate the controls in a composite element.
DelimiterDecimalThe character used to separate the integer portion of a numeric value from the fractional portion.
DelimiterElementThe delimiter used to separate elements within a segment.
DelimiterReleaseThe character used to escape other characters within a property.
DelimiterRepetitionThe character used to indicate a repeating element or control.
DelimiterSegmentThe character used to terminate a segment.
FileWriteModeDetermines how the output file is opened for writing.
FGroupAppPasswordThe application password as specified in the functional group header.
FGroupAppRecipientIdentificationThe name or code of the intended recipient of the message group.
FGroupAppRecipientIDQualifierThe qualifier for the recipient's identification (if it contains a code value).
FGroupAppSenderIdentificationThe name or code of the message group's sender.
FGroupAppSenderIDQualifierThe qualifier for the sender's identification (if it contains a code value).
FGroupAssociationAssignedCodeThe assigned code for the message type.
FGroupControllingAgencyA code value that indicates the agency responsible for maintaining the message specifications.
FGroupDateThe date that the group of messages was prepared.
FGroupGroupIdentificationThe identification value for the functional group.
FGroupMessageReleaseThe message release number for the message type appearing in the message group.
FGroupMessageVersionThe message version number for message type appearing in the functional group.
FGroupReferenceNumberThe reference number for the functional group.
FGroupTimeThe time that the group of messages was prepared.
InterchangeAckRequestIf this property is '1', an ACK was requested in response to this interchange.
InterchangeAgreementIdentifierThe identifier for the communication agreement used by the interchange.
InterchangeApplicationReferenceIf the interchange contains only one type of message, this can contain the identifier for the type of message.
InterchangeCharacterEncodingThe character encoding used by the interchange.
InterchangeCodeListVersionNumberThe identifier for the communication agreement used by the interchange.
InterchangeDateThe date that the interchange was prepared.
InterchangeProcessingPriorityCodeA 1-character code that requests a specific processing priority for the interchange.
InterchangeRecipientIdentificationThe identification for the interchange's recipient.
InterchangeRecipientIDQualifierThe qualifier for the recipient identification code.
InterchangeRecipientInternalIdentificationMore specific recipient identification for internal use.
InterchangeRecipientInternalSubIdentificationA sub-identification string for the receiver for internal use.
InterchangeRecipientPasswordA password to be verified by the recipient, such as a system or network password.
InterchangeRecipientPasswordQualifierA qualifier for the recipient password.
InterchangeReferenceNumberA reference number for the interchange.
InterchangeSenderIdentificationThe identification for the interchange's sender.
InterchangeSenderIDQualifierThe qualifier for the sender identification code.
InterchangeSenderInternalIdentificationMore specific sender identification for internal use.
InterchangeSenderInternalSubIdentificationA sub-identification string for the sender for internal use.
InterchangeSyntaxIdentifierA identifier specifying the controlling agency and valid character set.
InterchangeSyntaxVersionNumberA 1-character numeric value indicating the syntax version.
InterchangeTestIndicatorIf this property is '1', the interchange is a test interchange.
InterchangeTimeThe time that the interchange was prepared.
MsgAssociationAssignedCodeA code assigned to the message by the controlling organization.
MsgCodeListVersionNumberThe version number of the code list that should be used.
MsgCommonAccessReferenceA reference value to associate this message with related messages.
MsgControllingAgencyA code that identifies the controlling agency for this message type.
MsgFirstAndLastTransferA single-character property that indicates the first and last messages in a related set.
MsgMessageImplControllingAgencyA code value that identifies the controlling agency for the message implementation.
MsgMessageImplIdentificationIdentifies the message implementation.
MsgMessageImplReleaseIdentifies the release number for the message implementation.
MsgMessageImplVersionIdentifies the version number for the message implementation.
MsgMessageReleaseIdentifies the release number for the message.
MsgMessageSubsetControllingAgencyA code value that identifies the controlling agency for the message subset.
MsgMessageSubsetIdentificationIdentifies the message subset.
MsgMessageSubsetReleaseIdentifies the release number for the message subset.
MsgMessageSubsetVersionIdentifies the version number for the message subset.
MsgMessageTypeA code identifying the message's type.
MsgMessageTypeSubFunctionIdentificationA code identifying the sub-function of the message's type.
MsgMessageVersionIdentifies the version number for the message.
MsgReferenceNumberA unique reference number for the message.
MsgScenarioControllingAgencyIdentifies the controlling agency for the message scenario.
MsgScenarioIdentificationThe identifier for the message scenario.
MsgScenarioReleaseThe message scenario's release number.
MsgScenarioVersionThe message scenario's version number.
MsgSequenceOfTransfersSpecifies the message's position in a sequence.
OutputDataThe output data that has been written so far.
OutputFileThe name of the output file to which the EDI data will be written.
SegmentSuffixThe suffix that is appended to the end of a segment.

Method List


The following is the full list of the methods of the control with short descriptions. Click on the links for further details.

CloseCloses the writer.
ConfigSets or retrieves a configuration setting.
EndCompositeElementFinish writing the composite element.
EndFunctionalGroupWrite the UNE(FunctionalGroup) segment to the output file/data/stream.
EndInterchangeWrite the UNZ(Interchange) segment to the output file/data/stream.
EndMessageCloses the current message.
EndSegmentFinish writing the segment, add SegmentSuffix at the end of the segment.
ResetResets all properties to their default values.
StartCompositeElementStarts a composite element within the current segment.
StartFunctionalGroupStarts a new functional group in the EDI document.
StartInterchangeStarts a new interchange in the EDI document.
StartMessageStarts a new message in the EDI document.
StartSegmentStarts a new segment with the specified tag.
WriteComponentWrites a control element value to the current composite element.
WriteElementWrites an element value to the current segment.

Event List


The following is the full list of the events fired by the control with short descriptions. Click on the links for further details.

ErrorFires when an error occurs during message processing. Normally, the control fails with an error.
OutputFires when output data is written.

Config Settings


The following is a list of config settings for the control with short descriptions. Click on the links for further details.

DelimiterComponent Property (EDIFACTWriter Control)

The character used to separate the controls in a composite element.

Syntax

edifactwritercontrol.DelimiterComponent[=string]

Default Value

":"

Remarks

The character used to separate the components in a composite element.

This property is not available at design time.

Data Type

String

DelimiterDecimal Property (EDIFACTWriter Control)

The character used to separate the integer portion of a numeric value from the fractional portion.

Syntax

edifactwritercontrol.DelimiterDecimal[=string]

Default Value

"."

Remarks

The character used to separate the integer portion of a numeric value from the fractional portion.

This property is not available at design time.

Data Type

String

DelimiterElement Property (EDIFACTWriter Control)

The delimiter used to separate elements within a segment.

Syntax

edifactwritercontrol.DelimiterElement[=string]

Default Value

"+"

Remarks

The delimiter used to separate elements within a segment.

This property is not available at design time.

Data Type

String

DelimiterRelease Property (EDIFACTWriter Control)

The character used to escape other characters within a property.

Syntax

edifactwritercontrol.DelimiterRelease[=string]

Default Value

"?"

Remarks

The character used to escape other characters within a field. For example, with the default EDIFACT delimiters, "?+" should be considered "+" character that appears within a field, not an element separator.

This property is not available at design time.

Data Type

String

DelimiterRepetition Property (EDIFACTWriter Control)

The character used to indicate a repeating element or control.

Syntax

edifactwritercontrol.DelimiterRepetition[=string]

Default Value

"*(syntax 4) or empty(syntax 3)"

Remarks

The character used to indicate a repeating element or component.

This property is not available at design time.

Data Type

String

DelimiterSegment Property (EDIFACTWriter Control)

The character used to terminate a segment.

Syntax

edifactwritercontrol.DelimiterSegment[=string]

Default Value

"'"

Remarks

The character used to terminate a segment.

This property is not available at design time.

Data Type

String

FileWriteMode Property (EDIFACTWriter Control)

Determines how the output file is opened for writing.

Syntax

edifactwritercontrol.FileWriteMode[=integer]

Possible Values

fwmCreate(0), 
fwmOverwrite(1), 
fwmAppend(2)

Default Value

0

Remarks

When OutputFile is set, this property determines how the file will be opened.

fwmCreate (Default)Creates a new file. If the file already exists, the translation will fail.
fwmOverwriteOpens an existing file and overwrites its contents. If the file does not exist, a new file will be created.
fwmAppendOpens an existing file and appends data to the end of the file. If the file does not exist, a new file will be created.

This property is not available at design time.

Data Type

Integer

FGroupAppPassword Property (EDIFACTWriter Control)

The application password as specified in the functional group header.

Syntax

edifactwritercontrol.FGroupAppPassword[=string]

Default Value

""

Remarks

The application password as specified in the functional group header.

This is an alphanumeric field with a value up to 14 characters long.

This property is not available at design time.

Data Type

String

FGroupAppRecipientIdentification Property (EDIFACTWriter Control)

The name or code of the intended recipient of the message group.

Syntax

edifactwritercontrol.FGroupAppRecipientIdentification[=string]

Default Value

""

Remarks

The name or code of the intended recipient of the message group.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

FGroupAppRecipientIDQualifier Property (EDIFACTWriter Control)

The qualifier for the recipient's identification (if it contains a code value).

Syntax

edifactwritercontrol.FGroupAppRecipientIDQualifier[=string]

Default Value

""

Remarks

The qualifier for the recipient's identification (if it contains a code value).

This is an alphanumeric field with a value up to 4 characters long.

This property is not available at design time.

Data Type

String

FGroupAppSenderIdentification Property (EDIFACTWriter Control)

The name or code of the message group's sender.

Syntax

edifactwritercontrol.FGroupAppSenderIdentification[=string]

Default Value

""

Remarks

The name or code of the message group's sender.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

FGroupAppSenderIDQualifier Property (EDIFACTWriter Control)

The qualifier for the sender's identification (if it contains a code value).

Syntax

edifactwritercontrol.FGroupAppSenderIDQualifier[=string]

Default Value

""

Remarks

The qualifier for the sender's identification (if it contains a code value).

This is an alphanumeric field with a value up to 4 characters long.

This property is not available at design time.

Data Type

String

FGroupAssociationAssignedCode Property (EDIFACTWriter Control)

The assigned code for the message type.

Syntax

edifactwritercontrol.FGroupAssociationAssignedCode[=string]

Default Value

""

Remarks

The assigned code for the message type.

This is an alphanumeric field with a value up to 6 characters long.

This property is not available at design time.

Data Type

String

FGroupControllingAgency Property (EDIFACTWriter Control)

A code value that indicates the agency responsible for maintaining the message specifications.

Syntax

edifactwritercontrol.FGroupControllingAgency[=string]

Default Value

""

Remarks

A code value that indicates the agency responsible for maintaining the message specifications.

This is an alphanumeric field with a value up to 3 characters long.

This property is not available at design time.

Data Type

String

FGroupDate Property (EDIFACTWriter Control)

The date that the group of messages was prepared.

Syntax

edifactwritercontrol.FGroupDate[=string]

Default Value

""

Remarks

The date that the group of messages was prepared.

This property is not available at design time.

Data Type

String

FGroupGroupIdentification Property (EDIFACTWriter Control)

The identification value for the functional group.

Syntax

edifactwritercontrol.FGroupGroupIdentification[=string]

Default Value

""

Remarks

The identification value for the functional group.

This is an alphanumeric field with a value up to 6 characters long.

This property is not available at design time.

Data Type

String

FGroupMessageRelease Property (EDIFACTWriter Control)

The message release number for the message type appearing in the message group.

Syntax

edifactwritercontrol.FGroupMessageRelease[=string]

Default Value

""

Remarks

The message release number for the message type appearing in the message group.

This is an alphanumeric field with a value up to 3 characters long.

This property is not available at design time.

Data Type

String

FGroupMessageVersion Property (EDIFACTWriter Control)

The message version number for message type appearing in the functional group.

Syntax

edifactwritercontrol.FGroupMessageVersion[=string]

Default Value

""

Remarks

The message version number for message type appearing in the functional group.

This is an alphanumeric field with a value up to 3 characters long.

This property is not available at design time.

Data Type

String

FGroupReferenceNumber Property (EDIFACTWriter Control)

The reference number for the functional group.

Syntax

edifactwritercontrol.FGroupReferenceNumber[=string]

Default Value

""

Remarks

The reference number for the functional group.

This is an alphanumeric field with a value up to 14 characters long.

This property is not available at design time.

Data Type

String

FGroupTime Property (EDIFACTWriter Control)

The time that the group of messages was prepared.

Syntax

edifactwritercontrol.FGroupTime[=string]

Default Value

""

Remarks

The time that the group of messages was prepared.

This property is not available at design time.

Data Type

String

InterchangeAckRequest Property (EDIFACTWriter Control)

If this property is '1', an ACK was requested in response to this interchange.

Syntax

edifactwritercontrol.InterchangeAckRequest[=string]

Default Value

""

Remarks

If this field is '1', an ACK was requested in response to this interchange.

This property is not available at design time.

Data Type

String

InterchangeAgreementIdentifier Property (EDIFACTWriter Control)

The identifier for the communication agreement used by the interchange.

Syntax

edifactwritercontrol.InterchangeAgreementIdentifier[=string]

Default Value

""

Remarks

The identifier for the communication agreement used by the interchange.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

InterchangeApplicationReference Property (EDIFACTWriter Control)

If the interchange contains only one type of message, this can contain the identifier for the type of message.

Syntax

edifactwritercontrol.InterchangeApplicationReference[=string]

Default Value

""

Remarks

If the interchange contains only one type of message, this can contain the identifier for the type of message.

This is an alphanumeric field with a value up to 14 characters long.

This property is not available at design time.

Data Type

String

InterchangeCharacterEncoding Property (EDIFACTWriter Control)

The character encoding used by the interchange.

Syntax

edifactwritercontrol.InterchangeCharacterEncoding[=string]

Default Value

""

Remarks

The character encoding used by the interchange.

This is an alphanumeric field with a value up to 3 characters long, and is only present for EDIFACT syntax 4.

This property is not available at design time.

Data Type

String

InterchangeCodeListVersionNumber Property (EDIFACTWriter Control)

The identifier for the communication agreement used by the interchange.

Syntax

edifactwritercontrol.InterchangeCodeListVersionNumber[=string]

Default Value

""

Remarks

The identifier for the communication agreement used by the interchange.

This is an alphanumeric field with a value up to 6 characters long.

This property is not available at design time.

Data Type

String

InterchangeDate Property (EDIFACTWriter Control)

The date that the interchange was prepared.

Syntax

edifactwritercontrol.InterchangeDate[=string]

Default Value

""

Remarks

The date that the interchange was prepared.

This property is not available at design time.

Data Type

String

InterchangeProcessingPriorityCode Property (EDIFACTWriter Control)

A 1-character code that requests a specific processing priority for the interchange.

Syntax

edifactwritercontrol.InterchangeProcessingPriorityCode[=string]

Default Value

""

Remarks

A 1-character code that requests a specific processing priority for the interchange.

This property is not available at design time.

Data Type

String

InterchangeRecipientIdentification Property (EDIFACTWriter Control)

The identification for the interchange's recipient.

Syntax

edifactwritercontrol.InterchangeRecipientIdentification[=string]

Default Value

""

Remarks

The identification for the interchange's recipient.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

InterchangeRecipientIDQualifier Property (EDIFACTWriter Control)

The qualifier for the recipient identification code.

Syntax

edifactwritercontrol.InterchangeRecipientIDQualifier[=string]

Default Value

""

Remarks

The qualifier for the recipient identification code.

This is an alphanumeric field with a value up to 4 characters long.

This property is not available at design time.

Data Type

String

InterchangeRecipientInternalIdentification Property (EDIFACTWriter Control)

More specific recipient identification for internal use.

Syntax

edifactwritercontrol.InterchangeRecipientInternalIdentification[=string]

Default Value

""

Remarks

More specific recipient identification for internal use.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

InterchangeRecipientInternalSubIdentification Property (EDIFACTWriter Control)

A sub-identification string for the receiver for internal use.

Syntax

edifactwritercontrol.InterchangeRecipientInternalSubIdentification[=string]

Default Value

""

Remarks

A sub-identification string for the receiver for internal use.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

InterchangeRecipientPassword Property (EDIFACTWriter Control)

A password to be verified by the recipient, such as a system or network password.

Syntax

edifactwritercontrol.InterchangeRecipientPassword[=string]

Default Value

""

Remarks

A password to be verified by the recipient, such as a system or network password.

This is an alphanumeric field with a value up to 14 characters long.

This property is not available at design time.

Data Type

String

InterchangeRecipientPasswordQualifier Property (EDIFACTWriter Control)

A qualifier for the recipient password.

Syntax

edifactwritercontrol.InterchangeRecipientPasswordQualifier[=string]

Default Value

""

Remarks

A qualifier for the recipient password.

This is an alphanumeric field with a value up to 2 characters long.

This property is not available at design time.

Data Type

String

InterchangeReferenceNumber Property (EDIFACTWriter Control)

A reference number for the interchange.

Syntax

edifactwritercontrol.InterchangeReferenceNumber[=string]

Default Value

""

Remarks

A reference number for the interchange.

This is an alphanumeric field with a value up to 14 characters long.

This property is not available at design time.

Data Type

String

InterchangeSenderIdentification Property (EDIFACTWriter Control)

The identification for the interchange's sender.

Syntax

edifactwritercontrol.InterchangeSenderIdentification[=string]

Default Value

""

Remarks

The identification for the interchange's sender.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

InterchangeSenderIDQualifier Property (EDIFACTWriter Control)

The qualifier for the sender identification code.

Syntax

edifactwritercontrol.InterchangeSenderIDQualifier[=string]

Default Value

""

Remarks

The qualifier for the sender identification code.

This is an alphanumeric field with a value up to 4 characters long.

This property is not available at design time.

Data Type

String

InterchangeSenderInternalIdentification Property (EDIFACTWriter Control)

More specific sender identification for internal use.

Syntax

edifactwritercontrol.InterchangeSenderInternalIdentification[=string]

Default Value

""

Remarks

More specific sender identification for internal use.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

InterchangeSenderInternalSubIdentification Property (EDIFACTWriter Control)

A sub-identification string for the sender for internal use.

Syntax

edifactwritercontrol.InterchangeSenderInternalSubIdentification[=string]

Default Value

""

Remarks

A sub-identification string for the sender for internal use.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

InterchangeSyntaxIdentifier Property (EDIFACTWriter Control)

A identifier specifying the controlling agency and valid character set.

Syntax

edifactwritercontrol.InterchangeSyntaxIdentifier[=string]

Default Value

""

Remarks

A identifier specifying the controlling agency and valid character set.

This is an alphanumeric field with a value up to 4 characters long.

This property is not available at design time.

Data Type

String

InterchangeSyntaxVersionNumber Property (EDIFACTWriter Control)

A 1-character numeric value indicating the syntax version.

Syntax

edifactwritercontrol.InterchangeSyntaxVersionNumber[=string]

Default Value

""

Remarks

A 1-character numeric value indicating the syntax version.

This property is not available at design time.

Data Type

String

InterchangeTestIndicator Property (EDIFACTWriter Control)

If this property is '1', the interchange is a test interchange.

Syntax

edifactwritercontrol.InterchangeTestIndicator[=string]

Default Value

""

Remarks

If this field is '1', the interchange is a test interchange.

This property is not available at design time.

Data Type

String

InterchangeTime Property (EDIFACTWriter Control)

The time that the interchange was prepared.

Syntax

edifactwritercontrol.InterchangeTime[=string]

Default Value

""

Remarks

The time that the interchange was prepared.

This property is not available at design time.

Data Type

String

MsgAssociationAssignedCode Property (EDIFACTWriter Control)

A code assigned to the message by the controlling organization.

Syntax

edifactwritercontrol.MsgAssociationAssignedCode[=string]

Default Value

""

Remarks

A code assigned to the message by the controlling organization.

This is an alphanumeric field with a value up to 6 characters long.

This property is not available at design time.

Data Type

String

MsgCodeListVersionNumber Property (EDIFACTWriter Control)

The version number of the code list that should be used.

Syntax

edifactwritercontrol.MsgCodeListVersionNumber[=string]

Default Value

""

Remarks

The version number of the code list that should be used.

This is an alphanumeric field with a value up to 6 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgCommonAccessReference Property (EDIFACTWriter Control)

A reference value to associate this message with related messages.

Syntax

edifactwritercontrol.MsgCommonAccessReference[=string]

Default Value

""

Remarks

A reference value to associate this message with related messages.

This is an alphanumeric field with a value up to 35 characters long.

This property is not available at design time.

Data Type

String

MsgControllingAgency Property (EDIFACTWriter Control)

A code that identifies the controlling agency for this message type.

Syntax

edifactwritercontrol.MsgControllingAgency[=string]

Default Value

""

Remarks

A code that identifies the controlling agency for this message type.

This is an alphanumeric field with a value up to 3 characters long.

This property is not available at design time.

Data Type

String

MsgFirstAndLastTransfer Property (EDIFACTWriter Control)

A single-character property that indicates the first and last messages in a related set.

Syntax

edifactwritercontrol.MsgFirstAndLastTransfer[=string]

Default Value

""

Remarks

A single-character field that indicates the first and last messages in a related set.

This property is not available at design time.

Data Type

String

MsgMessageImplControllingAgency Property (EDIFACTWriter Control)

A code value that identifies the controlling agency for the message implementation.

Syntax

edifactwritercontrol.MsgMessageImplControllingAgency[=string]

Default Value

""

Remarks

A code value that identifies the controlling agency for the message implementation.

This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgMessageImplIdentification Property (EDIFACTWriter Control)

Identifies the message implementation.

Syntax

edifactwritercontrol.MsgMessageImplIdentification[=string]

Default Value

""

Remarks

Identifies the message implementation.

This is an alphanumeric field with a value up to 14 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgMessageImplRelease Property (EDIFACTWriter Control)

Identifies the release number for the message implementation.

Syntax

edifactwritercontrol.MsgMessageImplRelease[=string]

Default Value

""

Remarks

Identifies the release number for the message implementation.

This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgMessageImplVersion Property (EDIFACTWriter Control)

Identifies the version number for the message implementation.

Syntax

edifactwritercontrol.MsgMessageImplVersion[=string]

Default Value

""

Remarks

Identifies the version number for the message implementation.

This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgMessageRelease Property (EDIFACTWriter Control)

Identifies the release number for the message.

Syntax

edifactwritercontrol.MsgMessageRelease[=string]

Default Value

""

Remarks

Identifies the release number for the message.

This is an alphanumeric field with a value up to 3 characters long.

This property is not available at design time.

Data Type

String

MsgMessageSubsetControllingAgency Property (EDIFACTWriter Control)

A code value that identifies the controlling agency for the message subset.

Syntax

edifactwritercontrol.MsgMessageSubsetControllingAgency[=string]

Default Value

""

Remarks

A code value that identifies the controlling agency for the message subset.

This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgMessageSubsetIdentification Property (EDIFACTWriter Control)

Identifies the message subset.

Syntax

edifactwritercontrol.MsgMessageSubsetIdentification[=string]

Default Value

""

Remarks

Identifies the message subset.

This is an alphanumeric field with a value up to 14 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgMessageSubsetRelease Property (EDIFACTWriter Control)

Identifies the release number for the message subset.

Syntax

edifactwritercontrol.MsgMessageSubsetRelease[=string]

Default Value

""

Remarks

Identifies the release number for the message subset.

This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgMessageSubsetVersion Property (EDIFACTWriter Control)

Identifies the version number for the message subset.

Syntax

edifactwritercontrol.MsgMessageSubsetVersion[=string]

Default Value

""

Remarks

Identifies the version number for the message subset.

This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgMessageType Property (EDIFACTWriter Control)

A code identifying the message's type.

Syntax

edifactwritercontrol.MsgMessageType[=string]

Default Value

""

Remarks

A code identifying the message's type.

This is an alphanumeric field with a value up to 6 characters long.

This property is not available at design time.

Data Type

String

MsgMessageTypeSubFunctionIdentification Property (EDIFACTWriter Control)

A code identifying the sub-function of the message's type.

Syntax

edifactwritercontrol.MsgMessageTypeSubFunctionIdentification[=string]

Default Value

""

Remarks

A code identifying the sub-function of the message's type.

This is an alphanumeric field with a value up to 6 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgMessageVersion Property (EDIFACTWriter Control)

Identifies the version number for the message.

Syntax

edifactwritercontrol.MsgMessageVersion[=string]

Default Value

""

Remarks

Identifies the version number for the message.

This is an alphanumeric field with a value up to 3 characters long.

This property is not available at design time.

Data Type

String

MsgReferenceNumber Property (EDIFACTWriter Control)

A unique reference number for the message.

Syntax

edifactwritercontrol.MsgReferenceNumber[=string]

Default Value

""

Remarks

A unique reference number for the message.

This is an alphanumeric field with a value up to 14 characters long.

This property is not available at design time.

Data Type

String

MsgScenarioControllingAgency Property (EDIFACTWriter Control)

Identifies the controlling agency for the message scenario.

Syntax

edifactwritercontrol.MsgScenarioControllingAgency[=string]

Default Value

""

Remarks

Identifies the controlling agency for the message scenario.

This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgScenarioIdentification Property (EDIFACTWriter Control)

The identifier for the message scenario.

Syntax

edifactwritercontrol.MsgScenarioIdentification[=string]

Default Value

""

Remarks

The identifier for the message scenario.

This is an alphanumeric field with a value up to 14 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgScenarioRelease Property (EDIFACTWriter Control)

The message scenario's release number.

Syntax

edifactwritercontrol.MsgScenarioRelease[=string]

Default Value

""

Remarks

The message scenario's release number.

This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgScenarioVersion Property (EDIFACTWriter Control)

The message scenario's version number.

Syntax

edifactwritercontrol.MsgScenarioVersion[=string]

Default Value

""

Remarks

The message scenario's version number.

This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.

This property is not available at design time.

Data Type

String

MsgSequenceOfTransfers Property (EDIFACTWriter Control)

Specifies the message's position in a sequence.

Syntax

edifactwritercontrol.MsgSequenceOfTransfers[=string]

Default Value

""

Remarks

Specifies the message's position in a sequence.

This is an alphanumeric field with a value up to 2 characters long.

This property is not available at design time.

Data Type

String

OutputData Property (EDIFACTWriter Control)

The output data that has been written so far.

Syntax

edifactwritercontrol.OutputData[=string]

Default Value

""

Remarks

OutputData contains the entire EDI document that has been written so far. If writing to a file or stream, this property will be empty.

This property is not available at design time.

Data Type

String

OutputFile Property (EDIFACTWriter Control)

The name of the output file to which the EDI data will be written.

Syntax

edifactwritercontrol.OutputFile[=string]

Default Value

""

Remarks

FileWriteMode property determines how the file is opened for writing. If OutputFile is empty, no file will be written and the OutputData property will contain the EDI data instead.

This property is not available at design time.

Data Type

String

SegmentSuffix Property (EDIFACTWriter Control)

The suffix that is appended to the end of a segment.

Syntax

edifactwritercontrol.SegmentSuffix[=integer]

Possible Values

ssNone(0), 
ssCR(1), 
ssLF(2), 
ssCRLF(3)

Default Value

3

Remarks

Possible values are:

ssNone (0)No suffix is appended to the segment.
ssCR (1)A carriage return (ASCII 13) is appended to the segment.
ssLF (2)A line feed (ASCII 10) is appended to the segment.
ssCRLF (3)A carriage return followed by a line feed (ASCII 13 and 10) is appended to the segment. This is the default value.

This property is not available at design time.

Data Type

Integer

Close Method (EDIFACTWriter Control)

Closes the writer.

Syntax

edifactwritercontrol.Close 

Remarks

Calling Close will close the writer and release any resources associated with it. After calling Close, the writer cannot be used unless it is re-initialized.

Config Method (EDIFACTWriter Control)

Sets or retrieves a configuration setting.

Syntax

edifactwritercontrol.Config ConfigurationString

Remarks

Config is a generic method available in every control. It is used to set and retrieve configuration settings for the control.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the control, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

EndCompositeElement Method (EDIFACTWriter Control)

Finish writing the composite element.

Syntax

edifactwritercontrol.EndCompositeElement 

Remarks

This method is used to close a CompositeElement. This method may only be called after a successful call to StartCompositeElement

EndFunctionalGroup Method (EDIFACTWriter Control)

Write the UNE(FunctionalGroup) segment to the output file/data/stream.

Syntax

edifactwritercontrol.EndFunctionalGroup 

Remarks

This method is used to close a FunctionalGroup. This method may only be called after a successful call to StartFunctionalGroup

EndInterchange Method (EDIFACTWriter Control)

Write the UNZ(Interchange) segment to the output file/data/stream.

Syntax

edifactwritercontrol.EndInterchange 

Remarks

This method is used to close an Interchange. This method may only be called after a successful call to StartInterchange

EndMessage Method (EDIFACTWriter Control)

Closes the current message.

Syntax

edifactwritercontrol.EndMessage 

Remarks

Calling this method will close the current message. If no message is open, an error will be raised. This method will also write the required Message Trailer (UNT) segment to the output.

EndSegment Method (EDIFACTWriter Control)

Finish writing the segment, add SegmentSuffix at the end of the segment.

Syntax

edifactwritercontrol.EndSegment 

Remarks

This method is used to close a Segment. This method may only be called after a successful call to StartSegment

Reset Method (EDIFACTWriter Control)

Resets all properties to their default values.

Syntax

edifactwritercontrol.Reset 

Remarks

This method resets all properties of the component to their default values as specified in the property definitions.

StartCompositeElement Method (EDIFACTWriter Control)

Starts a composite element within the current segment.

Syntax

edifactwritercontrol.StartCompositeElement 

Remarks

This method starts a composite element within the current segment. The composite element can contain multiple component elements. The composite element is ended by calling the EndCompositeElement method. Component elements within the composite are added by calling the WriteComponent method.

StartFunctionalGroup Method (EDIFACTWriter Control)

Starts a new functional group in the EDI document.

Syntax

edifactwritercontrol.StartFunctionalGroup 

Remarks

This method starts a new functional group in the EDI document. The functional group fields must be set using the appropriate properties before calling this method. The functional group is ended by calling the EndFunctionalGroup method. The functional group header segment (UNG) is written to the output when this method is called.

StartInterchange Method (EDIFACTWriter Control)

Starts a new interchange in the EDI document.

Syntax

edifactwritercontrol.StartInterchange 

Remarks

This method starts a new interchange in the EDI document. The interchange fields must be set using the appropriate properties before calling this method. The interchange is ended by calling the EndInterchange method. The interchange header segment (UNB) is written to the output when this method is called. If opening a new interchange would result in an invalid structure (for example, starting a new interchange before ending the previous one), an error will be raised.

StartMessage Method (EDIFACTWriter Control)

Starts a new message in the EDI document.

Syntax

edifactwritercontrol.StartMessage 

Remarks

This method starts a new message in the EDI document. The message fields must be set using the appropriate properties before calling this method. The message is ended by calling the EndMessage method. The message header segment (UNH) is written to the output when this method is called. If opening a new message would result in an invalid structure (for example, starting a new message before ending the previous one), an error will be raised.

StartSegment Method (EDIFACTWriter Control)

Starts a new segment with the specified tag.

Syntax

edifactwritercontrol.StartSegment tag

Remarks

This method starts a new segment with the specified tag. The segment is ended by calling the EndSegment method. Element values within the segment are added by calling the WriteElement method. Composite elements can be added to the segment by calling the StartCompositeElement method. If starting a new segment would result in an invalid structure (for example, starting a new segment before ending the previous one), an error will be raised.

WriteComponent Method (EDIFACTWriter Control)

Writes a control element value to the current composite element.

Syntax

edifactwritercontrol.WriteComponent val

Remarks

This method writes a component element value to the current composite element. The composite element must be started by calling the StartCompositeElement method before calling this method. The composite element is ended by calling the EndCompositeElement method. If this method is called when not within a composite element, an error will be raised.

WriteElement Method (EDIFACTWriter Control)

Writes an element value to the current segment.

Syntax

edifactwritercontrol.WriteElement val

Remarks

This method writes an element value to the current segment. The segment must be started by calling the StartSegment method before calling this method. The segment is ended by calling the EndSegment method. If this method is called when not within a segment, an error will be raised.

Error Event (EDIFACTWriter Control)

Fires when an error occurs during message processing. Normally, the control fails with an error.

Syntax

Sub edifactwritercontrol_Error(ErrorCode As Integer, Description As String)

Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally, the control fails with an error.

ConnectionId is the associated client Id, ErrorCode contains an error code, and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

Output Event (EDIFACTWriter Control)

Fires when output data is written.

Syntax

Sub edifactwritercontrol_Output(Data As String)

Remarks

This event is fired when output data is written. The Data parameter contains the segment that was written.

Config Settings (EDIFACTWriter Control)

The control accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the control, access to these internal properties is provided through the Config method.

Trappable Errors (EDIFACTWriter Control)

EDIFACTWriter Errors

20203    Invalid argument.
20305    Cannot write to file.
21100    Encountered an unexpected segment tag.
21101    Attempted to perform an action while the component was busy, or close an incomplete interchange.
21206    Tried to perform an operation in a bad state (such as ending an interchange before starting one).
21207    Tried to end an interchange with no contents.