X12Reader Component
Properties Methods Events Config Settings Errors
The X12Reader component efficiently parses complete X12 transmissions, providing a convenient way to extract and explore data from all included transaction sets.
Syntax
TedX12Reader
Remarks
The component allows you to parse an incoming EDI document. To parse a document, first, use LoadSchema to load a schema file into the component. Next, select the document you want to process by setting InputFile or InputData and calling Parse.
As the component processes the document, its events will fire and the contents of the document will be available in the Interchange, FunctionalGroup, Message, Segment, Element, and Component properties. The corresponding *Index properties can be thought of as a path within the document. For example, setting the MessageIndex property will cause the SegmentCount property to be updated with the number of segments within the selected message, and then the SegmentIndex property can be used to select one of the segments within that message.
To manage the amount of memory used during processing, the BuildDOM property can be used to select how much of the message will be available in the properties at once:
- bdEntireDocument - The entire document will be available at once.
- bdInterchange - Only the current interchange and its contents will be available.
- bdMessage - Only the current message will be available.
- bdNone - Only the current segment and its elements will be available.
During parsing, the component performs basic validation of the incoming document. If an error is encountered, the ValidateWarning event will fire.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
| AckType | Specifies the type of ACK that will be generated by GenerateAck . |
| BuildDOM | Specifies how much of the current document should be held in memory. |
| ComponentDataType | The type of data contained in the element. |
| ComponentIsComposite | Specifies whether the element is a simple or composite element. |
| ComponentMaxLen | For a simple element, this specifies the maximum length of the element according to the schema. |
| ComponentMinLen | For a simple element, this specifies the minimum length of the element according to the schema. |
| ComponentSchemaDesc | The description of the element as specified in the schema. |
| ComponentSchemaName | The name of the element as specified in the schema. |
| ComponentValue | If the element is a simple element, this property contains its value. |
| ComponentCount | The number of components in the current Element. |
| ComponentIndex | The index of the current Component. |
| DelimiterComponent | The delimiter separating components. |
| DelimiterElement | The delimiter separating elements. |
| DelimiterRepetition | The delimiter separating components. |
| DelimiterSegment | The delimiter separating segments. |
| ElementDataType | The type of data contained in the element. |
| ElementIsComposite | Specifies whether the element is a simple or composite element. |
| ElementMaxLen | For a simple element, this specifies the maximum length of the element according to the schema. |
| ElementMinLen | For a simple element, this specifies the minimum length of the element according to the schema. |
| ElementSchemaDesc | The description of the element as specified in the schema. |
| ElementSchemaName | The name of the element as specified in the schema. |
| ElementValue | If the element is a simple element, this property contains its value. |
| ElementCount | The number of elements in the current Segment. |
| ElementIndex | The index of the current Element. |
| FGroupAppReceiverCode | The name or code of the intended receiver of the transaction set group. |
| FGroupAppSenderCode | Code identifying the sender of FunctionalGroup This is an alphanumeric property with a value between 2 and 15 characters long. |
| FGroupDate | The date that the group of transaction sets was prepared. |
| FGroupFunctionalIdentifierCode | A code identifying the type of transaction sets included in the functional group. |
| FGroupGroupControlNum | An identification number assigned by the sender to uniquely identify the group of transaction sets. |
| FGroupResponsibleAgencyCode | A code identifying the issuer of the standard that the transaction set conforms to. |
| FGroupTime | The time that the group of transaction sets was prepared. |
| FGroupVersion | Code indicating the version of the X12 standard used to construct the transaction set. |
| FunctionalGroupCount | The number of FunctionalGroups in the current Interchange. |
| FunctionalGroupIndex | The index of the current FunctionalGroup. |
| InputData | The EDI message, specified as a string. |
| InputFile | The file containing the EDI message. |
| InterchangeAckRequest | Code indicating whether an interchange acknowledgment is requested. |
| InterchangeAuthorizationInfo | Information used for additional identification or authorization of the interchange sender or the data in the interchange. |
| InterchangeAuthorizationInfoQualifier | A code indicating the type of data supplied in Authorization Information property. |
| InterchangeDate | The date that the Interchange was prepared. |
| InterchangeInterchangeControlNum | A control number assigned by the sender to uniquely identify the interchange. |
| InterchangeInterchangeControlVersionNum | A code specifying the version of the X12 standard used to construct the Interchange. |
| InterchangeReceiverID | The identification code of the receiver of the transaction set. |
| InterchangeReceiverIDQualifier | A code that identifies the format of the receiver ID. |
| InterchangeSecurityInfo | Coded security information associated with the Interchange. |
| InterchangeSecurityInfoQualifier | A code indicating the type of data in the Security Information property. |
| InterchangeSenderID | The identification code of the sender of the transaction set. |
| InterchangeSenderIDQualifier | A code that identifies the format of the sender ID. |
| InterchangeTime | The time that the Interchange sets was prepared. |
| InterchangeUsageIndicator | Code to indicate whether the interchange is a test or production. |
| InterchangeCount | The number of Interchanges in the document. |
| InterchangeIndex | The index of the current Interchange. |
| Loop | Specifies the loop to load segments from. |
| SegmentOptional | Specifies whether the segment is required or optional. |
| SegmentPath | Contains the path to the segment, including the groups that the segment is contained in. |
| SegmentSchemaPath | Contains a numeric representation of the path to the segment, using the indexes within the schema, such as \\4[3]\\5[6]\\7[8] . |
| SegmentTag | The tag of the segment, such as BGM , DTM , FTX , etc. |
| SegmentCount | The number of segments in the current TransactionSet. |
| SegmentIndex | This property is used to specify a Segment within the current TransactionSet . |
| TransSetImpConventionReference | Reference used to identify the implementation convention. |
| TransSetTransactionSetControlNum | The unique transaction set control number assigned for a transaction set. |
| TransSetTransactionSetIDCode | The identifier code for the transaction set. |
| TransactionSetCount | The number of TransactionSets in the current FunctionalGroup. |
| TransactionSetIndex | The current TransactionSet index. |
| ValidateOnParse | When true, the component will validate any documents it parses. |
| ValidationErrorCount | The number of records in the ValidationError arrays. |
| ValidationErrorColumn | The column number where the error occurred. |
| ValidationErrorComponentIndex | This property holds the position of the component element where the error occurred. |
| ValidationErrorElementIndex | This property holds the position of the element where the error occurred. |
| ValidationErrorErrorCode | The ErrorCode property contains the type of error encountered. |
| ValidationErrorErrorMessage | ErrorMessage is a textual description of the error. |
| ValidationErrorErrorType | Indicates the level of the document where the error was encountered. |
| ValidationErrorFGroupIndex | This property holds the position of the functional group where the error occurred. |
| ValidationErrorInterchangeIndex | This property holds the position of the interchange where the error occurred. |
| ValidationErrorLine | The line number where the error occurred. |
| ValidationErrorPosition | This property holds the byte position in the EDI stream where the error occurred. |
| ValidationErrorSegmentIndex | This property is the index of the segment where the error occurred. |
| ValidationErrorSegmentTag | This property specifies the tag name of the segment where the error occurred. |
| ValidationErrorTransactionSetIndex | This property holds the position of the message where the error occurred. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
| Config | Sets or retrieves a configuration setting. |
| GenerateAck | Generates an ACK in response to the most recently parsed TransactionSet. |
| GetElementValue | Returns the value of the element or component at the specified path. |
| LoadSchema | Loads schema information from a file or string data. |
| Parse | Parse the EDI document and fire parsing events. |
| Reset | Sets the component to its initial state. |
| SchemaCode | Defines a code value within a list of codes. |
| SchemaCodeList | Defines a list of codes. |
| SchemaComposite | Defines a composite element. |
| SchemaElement | Defines a simple element. |
| SchemaElementRef | Adds a reference to an element in a segment or composite element. |
| SchemaEnd | Ends a schema definition. |
| SchemaGroup | Defines a group of segments. |
| SchemaMessage | Defines a message. |
| SchemaSegment | Defines a segment. |
| SchemaSegmentRef | Adds a reference to a segment in a message or group. |
| SchemaStart | Starts a schema definition. |
| Validate | Validate the EDI document and warn about any errors encountered. |
Event List
The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.
| EndFunctionalGroup | Fires at the end of a functional group while parsing. |
| EndInterchange | Fires at the end of a interchange while parsing. |
| EndLoop | Fires at the end of a loop while parsing. |
| EndTransactionSet | Fires at the end of a transaction set while parsing. |
| Error | Fires when a parsing error occurs. |
| ResolveSchema | Fires to request schema information for a specific transaction set. |
| Segment | Fires at the end of a Segment while parsing. |
| StartFunctionalGroup | Fires at the beginning of a functional group while parsing. |
| StartInterchange | Fires at the beginning of an interchange while parsing. |
| StartLoop | Fires at the beginning of a loop while parsing a transaction set. |
| StartTransactionSet | Fires at the beginning of a transaction set while parsing. |
| ValidateWarning | Fires to warn about validation errors. |
Config Settings
The following is a list of config settings for the component with short descriptions. Click on the links for further details.
| InputFormat | The format of the input document. |
| MaxValidationErrors | The maximum number of validation errors to return. |
AckType Property (X12Reader Component)
Specifies the type of ACK that will be generated by GenerateAck .
Syntax
__property TedX12ReaderAckTypes AckType = { read=FAckType, write=FSetAckType };
enum TedX12ReaderAckTypes {
at997=0,
at999=1,
atTA1=2
};
Default Value
at997
Remarks
This setting specifies the type of ACK that will be generated when GenerateAck is called. Options include:
| 997 Functional Acknowledgement (at997 - 0) | A 997 functional acknowledgement. If any syntax errors are encountered when parsing the data, the response will indicate the details of the issue. |
| 999 Implementation Acknowledgement (at999 - 0) | A 999 implementation acknowledgement. This ACK replaces a 997 ACK when in a healthcare setting, and can also report issues with standards such as HIPAA compliance. |
| TA1 Interchange Acknowledgement (atTA1 - 0) | A TA1 technical acknowledgement, which confirms the ISA header and IEA footer are valid but does not report on the processing of the contents. |
This property is not available at design time.
Data Type
Integer
BuildDOM Property (X12Reader Component)
Specifies how much of the current document should be held in memory.
Syntax
__property TedX12ReaderBuildDOMs BuildDOM = { read=FBuildDOM, write=FSetBuildDOM };
enum TedX12ReaderBuildDOMs {
bdEntireDocument=0,
bdInterchange=1,
bdTranSet=2,
bdNone=3
};
Default Value
bdEntireDocument
Remarks
Set BuildDOM to bdEntireDocument (0) when you need to browse the current document.
Use bdInterchange (1) when parsing large documents to tell the component to only hold an internal object model of the current Interchange being parsed. When this value is used, and a new Interchange is encountered during parsing, the old interchange is cleared from memory. If the input contains a single Interchange, this is equivalent to using bdEntireDocument.
Use bdTranSet (2) when parsing large documents to tell the component to only hold an internal object model of the current transaction being parsed. When this value is used, and a new transaction is encountered during parsing, the old transaction is cleared from memory.
A value of bdNone (3) will tell the component to not save any internal state of the document being parsed, and thus browsing will be unavailable.
This property is not available at design time.
Data Type
Integer
ComponentDataType Property (X12Reader Component)
The type of data contained in the element.
Syntax
__property String ComponentDataType = { read=FComponentDataType };
Default Value
""
Remarks
The type of data contained in the element.
Possible values for EDIFACT include:
| A | The element can only contain alphabetic characters. |
| AN | The element can contain any alphanumeric characters. |
| N | The element can only contain numeric characters. |
| composite | The element is a composite element containing multiple components. |
Possible values for X12 include:
| AN | The element can contain any alphanumeric characters. |
| ID | The element contains an identifier for a code value. |
| Nn | The element contains a numeric integer value. |
| R | The element contains a number with an optional decimal value. |
| DT | The element contains a string representing a date. |
| TM | The element contains a string representing a time. |
| B | The element contains binary data. |
| composite | The element is a composite element containing multiple components. |
This property is read-only and not available at design time.
Data Type
String
ComponentIsComposite Property (X12Reader Component)
Specifies whether the element is a simple or composite element.
Syntax
__property bool ComponentIsComposite = { read=FComponentIsComposite };
Default Value
false
Remarks
Specifies whether the element is a simple or composite element. If true, the element is a composite element that contains other components.
This property is read-only and not available at design time.
Data Type
Boolean
ComponentMaxLen Property (X12Reader Component)
For a simple element, this specifies the maximum length of the element according to the schema.
Syntax
__property int ComponentMaxLen = { read=FComponentMaxLen };
Default Value
0
Remarks
For a simple element, this specifies the maximum length of the element according to the schema.
This property is read-only and not available at design time.
Data Type
Integer
ComponentMinLen Property (X12Reader Component)
For a simple element, this specifies the minimum length of the element according to the schema.
Syntax
__property int ComponentMinLen = { read=FComponentMinLen };
Default Value
0
Remarks
For a simple element, this specifies the minimum length of the element according to the schema.
This property is read-only and not available at design time.
Data Type
Integer
ComponentSchemaDesc Property (X12Reader Component)
The description of the element as specified in the schema.
Syntax
__property String ComponentSchemaDesc = { read=FComponentSchemaDesc };
Default Value
""
Remarks
The description of the element as specified in the schema.
This property is read-only and not available at design time.
Data Type
String
ComponentSchemaName Property (X12Reader Component)
The name of the element as specified in the schema.
Syntax
__property String ComponentSchemaName = { read=FComponentSchemaName };
Default Value
""
Remarks
The name of the element as specified in the schema.
This property is read-only and not available at design time.
Data Type
String
ComponentValue Property (X12Reader Component)
If the element is a simple element, this property contains its value.
Syntax
__property String ComponentValue = { read=FComponentValue };
Default Value
""
Remarks
If the element is a simple element, this field contains its value.
This property is read-only and not available at design time.
Data Type
String
ComponentCount Property (X12Reader Component)
The number of components in the current Element.
Syntax
__property int ComponentCount = { read=FComponentCount };
Default Value
0
Remarks
If the current Element is composite, this property contains the number of components within the element.
This property is read-only.
Data Type
Integer
ComponentIndex Property (X12Reader Component)
The index of the current Component.
Syntax
__property int ComponentIndex = { read=FComponentIndex, write=FSetComponentIndex };
Default Value
1
Remarks
If the current Element is composite, this property is used to specify a Component within the element.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory. You can then use InterchangeIndex, FunctionalGroupIndex, MessageIndex, SegmentIndex, ElementIndex and ComponentIndex to navigate to a specific Component within the parsed document.
This property is not available at design time.
Data Type
Integer
DelimiterComponent Property (X12Reader Component)
The delimiter separating components.
Syntax
__property String DelimiterComponent = { read=FDelimiterComponent, write=FSetDelimiterComponent };
Default Value
":"
Remarks
The delimiter separating components.
In X12Reader, this type is used to hold the delimiters found when parsing the component, while in X12Writer the fields can be set to choose the delimiters that will be used when writing
This property is not available at design time.
Data Type
String
DelimiterElement Property (X12Reader Component)
The delimiter separating elements.
Syntax
__property String DelimiterElement = { read=FDelimiterElement, write=FSetDelimiterElement };
Default Value
"*"
Remarks
The delimiter separating elements.
In X12Reader, this type is used to hold the delimiters found when parsing the element, while in X12Writer the fields can be set to choose the delimiters that will be used when writing
This property is not available at design time.
Data Type
String
DelimiterRepetition Property (X12Reader Component)
The delimiter separating components.
Syntax
__property String DelimiterRepetition = { read=FDelimiterRepetition, write=FSetDelimiterRepetition };
Default Value
"^"
Remarks
The delimiter separating components.
In X12Reader, this type is used to hold the delimiters found when parsing the component, while in X12Writer the fields can be set to choose the delimiters that will be used when writing
This property is not available at design time.
Data Type
String
DelimiterSegment Property (X12Reader Component)
The delimiter separating segments.
Syntax
__property String DelimiterSegment = { read=FDelimiterSegment, write=FSetDelimiterSegment };
Default Value
"~"
Remarks
The delimiter separating segments.
In X12Reader, this type is used to hold the delimiters found when parsing the segment, while in X12Writer the fields can be set to choose the delimiters that will be used when writing
This property is not available at design time.
Data Type
String
ElementDataType Property (X12Reader Component)
The type of data contained in the element.
Syntax
__property String ElementDataType = { read=FElementDataType };
Default Value
""
Remarks
The type of data contained in the element.
Possible values for EDIFACT include:
| A | The element can only contain alphabetic characters. |
| AN | The element can contain any alphanumeric characters. |
| N | The element can only contain numeric characters. |
| composite | The element is a composite element containing multiple components. |
Possible values for X12 include:
| AN | The element can contain any alphanumeric characters. |
| ID | The element contains an identifier for a code value. |
| Nn | The element contains a numeric integer value. |
| R | The element contains a number with an optional decimal value. |
| DT | The element contains a string representing a date. |
| TM | The element contains a string representing a time. |
| B | The element contains binary data. |
| composite | The element is a composite element containing multiple components. |
This property is read-only and not available at design time.
Data Type
String
ElementIsComposite Property (X12Reader Component)
Specifies whether the element is a simple or composite element.
Syntax
__property bool ElementIsComposite = { read=FElementIsComposite };
Default Value
false
Remarks
Specifies whether the element is a simple or composite element. If true, the element is a composite element that contains other components.
This property is read-only and not available at design time.
Data Type
Boolean
ElementMaxLen Property (X12Reader Component)
For a simple element, this specifies the maximum length of the element according to the schema.
Syntax
__property int ElementMaxLen = { read=FElementMaxLen };
Default Value
0
Remarks
For a simple element, this specifies the maximum length of the element according to the schema.
This property is read-only and not available at design time.
Data Type
Integer
ElementMinLen Property (X12Reader Component)
For a simple element, this specifies the minimum length of the element according to the schema.
Syntax
__property int ElementMinLen = { read=FElementMinLen };
Default Value
0
Remarks
For a simple element, this specifies the minimum length of the element according to the schema.
This property is read-only and not available at design time.
Data Type
Integer
ElementSchemaDesc Property (X12Reader Component)
The description of the element as specified in the schema.
Syntax
__property String ElementSchemaDesc = { read=FElementSchemaDesc };
Default Value
""
Remarks
The description of the element as specified in the schema.
This property is read-only and not available at design time.
Data Type
String
ElementSchemaName Property (X12Reader Component)
The name of the element as specified in the schema.
Syntax
__property String ElementSchemaName = { read=FElementSchemaName };
Default Value
""
Remarks
The name of the element as specified in the schema.
This property is read-only and not available at design time.
Data Type
String
ElementValue Property (X12Reader Component)
If the element is a simple element, this property contains its value.
Syntax
__property String ElementValue = { read=FElementValue };
Default Value
""
Remarks
If the element is a simple element, this field contains its value.
This property is read-only and not available at design time.
Data Type
String
ElementCount Property (X12Reader Component)
The number of elements in the current Segment.
Syntax
__property int ElementCount = { read=FElementCount };
Default Value
0
Remarks
This property contains the total number of elements in the current Segment.
This property is read-only.
Data Type
Integer
ElementIndex Property (X12Reader Component)
The index of the current Element.
Syntax
__property int ElementIndex = { read=FElementIndex, write=FSetElementIndex };
Default Value
1
Remarks
This property is used to specify an Element within the current Segment.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory. You can then use InterchangeIndex, FunctionalGroupIndex, MessageIndex, SegmentIndex and ElementIndex to navigate to specific Element within the parsed document.
This property is not available at design time.
Data Type
Integer
FGroupAppReceiverCode Property (X12Reader Component)
The name or code of the intended receiver of the transaction set group.
Syntax
__property String FGroupAppReceiverCode = { read=FFGroupAppReceiverCode, write=FSetFGroupAppReceiverCode };
Default Value
""
Remarks
The name or code of the intended receiver of the transaction set group.
This is an alphanumeric field with a value between 2 and 15 characters.
This property is not available at design time.
Data Type
String
FGroupAppSenderCode Property (X12Reader Component)
Code identifying the sender of FunctionalGroup This is an alphanumeric property with a value between 2 and 15 characters long.
Syntax
__property String FGroupAppSenderCode = { read=FFGroupAppSenderCode, write=FSetFGroupAppSenderCode };
Default Value
""
Remarks
Code identifying the sender of FunctionalGroup
This is an alphanumeric field with a value between 2 and 15 characters long.
This property is not available at design time.
Data Type
String
FGroupDate Property (X12Reader Component)
The date that the group of transaction sets was prepared.
Syntax
__property String FGroupDate = { read=FFGroupDate, write=FSetFGroupDate };
Default Value
""
Remarks
The date that the group of transaction sets was prepared.
This is a numeric field with a value in the format YYMMDD.
This property is not available at design time.
Data Type
String
FGroupFunctionalIdentifierCode Property (X12Reader Component)
A code identifying the type of transaction sets included in the functional group.
Syntax
__property String FGroupFunctionalIdentifierCode = { read=FFGroupFunctionalIdentifierCode, write=FSetFGroupFunctionalIdentifierCode };
Default Value
""
Remarks
A code identifying the type of transaction sets included in the functional group.
This is an alphanumeric field with a code value between of 2 characters.
This property is not available at design time.
Data Type
String
FGroupGroupControlNum Property (X12Reader Component)
An identification number assigned by the sender to uniquely identify the group of transaction sets.
Syntax
__property String FGroupGroupControlNum = { read=FFGroupGroupControlNum, write=FSetFGroupGroupControlNum };
Default Value
""
Remarks
An identification number assigned by the sender to uniquely identify the group of transaction sets.
This is a numeric field with a value between 1 and 9 digits.
This property is not available at design time.
Data Type
String
FGroupResponsibleAgencyCode Property (X12Reader Component)
A code identifying the issuer of the standard that the transaction set conforms to.
Syntax
__property String FGroupResponsibleAgencyCode = { read=FFGroupResponsibleAgencyCode, write=FSetFGroupResponsibleAgencyCode };
Default Value
""
Remarks
A code identifying the issuer of the standard that the transaction set conforms to.
This is an alphanumeric field with a code value of 1 to 2 characters.
This property is not available at design time.
Data Type
String
FGroupTime Property (X12Reader Component)
The time that the group of transaction sets was prepared.
Syntax
__property String FGroupTime = { read=FFGroupTime, write=FSetFGroupTime };
Default Value
""
Remarks
The time that the group of transaction sets was prepared.
This is a numeric field with a value between 4 and 8 digits in the format HHMM, HHMMSS, or HHMMSSDD. Time should be in the 24-hour format.
This property is not available at design time.
Data Type
String
FGroupVersion Property (X12Reader Component)
Code indicating the version of the X12 standard used to construct the transaction set.
Syntax
__property String FGroupVersion = { read=FFGroupVersion, write=FSetFGroupVersion };
Default Value
""
Remarks
Code indicating the version of the X12 standard used to construct the transaction set.
This is an alphanumeric field with a code value between 1 and 12 characters.
This property is not available at design time.
Data Type
String
FunctionalGroupCount Property (X12Reader Component)
The number of FunctionalGroups in the current Interchange.
Syntax
__property int FunctionalGroupCount = { read=FFunctionalGroupCount };
Default Value
0
Remarks
This property contains the number of FunctionalGroups in the current Interchange.
This property is read-only.
Data Type
Integer
FunctionalGroupIndex Property (X12Reader Component)
The index of the current FunctionalGroup.
Syntax
__property int FunctionalGroupIndex = { read=FFunctionalGroupIndex, write=FSetFunctionalGroupIndex };
Default Value
1
Remarks
This property is used to specify a FunctionalGroup within the current Interchange.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory, including all interchanges, and functional groups. You can then use InterchangeIndex and FunctionalGroupIndex to navigate to a specific FunctionalGroup within the parsed document.
This property is not available at design time.
Data Type
Integer
InputData Property (X12Reader Component)
The EDI message, specified as a string.
Syntax
__property String InputData = { read=FInputData, write=FSetInputData };
Default Value
""
Remarks
Set this property to specify the input EDI message as a string. The message can then be parsed with Parse.
This property is not available at design time.
Data Type
String
InputFile Property (X12Reader Component)
The file containing the EDI message.
Syntax
__property String InputFile = { read=FInputFile, write=FSetInputFile };
Default Value
""
Remarks
Set this property to specify the input EDI message as a file. The message can then be parsed with Parse.
If the file is not found or cannot be opened, an error will be returned.
Note: If both InputFile and InputData are set, InputData takes precedence.
This property is not available at design time.
Data Type
String
InterchangeAckRequest Property (X12Reader Component)
Code indicating whether an interchange acknowledgment is requested.
Syntax
__property String InterchangeAckRequest = { read=FInterchangeAckRequest, write=FSetInterchangeAckRequest };
Default Value
""
Remarks
Code indicating whether an interchange acknowledgment is requested.
This is an alphanumeric field with a code value of 1 character, either "0" (no acknowledgment requested) or "1" (acknowledgment requested).
This property is not available at design time.
Data Type
String
InterchangeAuthorizationInfo Property (X12Reader Component)
Information used for additional identification or authorization of the interchange sender or the data in the interchange.
Syntax
__property String InterchangeAuthorizationInfo = { read=FInterchangeAuthorizationInfo, write=FSetInterchangeAuthorizationInfo };
Default Value
""
Remarks
Information used for additional identification or authorization of the interchange sender or the data in the interchange.
The type of information is set by the AuthorizationInfoQual field.
This property is not available at design time.
Data Type
String
InterchangeAuthorizationInfoQualifier Property (X12Reader Component)
A code indicating the type of data supplied in Authorization Information property.
Syntax
__property String InterchangeAuthorizationInfoQualifier = { read=FInterchangeAuthorizationInfoQualifier, write=FSetInterchangeAuthorizationInfoQualifier };
Default Value
""
Remarks
A code indicating the type of data supplied in Authorization Information field.
This is an alphanumeric field with a code value of 2 characters.
This property is not available at design time.
Data Type
String
InterchangeDate Property (X12Reader Component)
The date that the Interchange was prepared.
Syntax
__property String InterchangeDate = { read=FInterchangeDate, write=FSetInterchangeDate };
Default Value
""
Remarks
The date that the Interchange was prepared.
This is a numeric field with a value of 6 digits in the format YYMMDD.
This property is not available at design time.
Data Type
String
InterchangeInterchangeControlNum Property (X12Reader Component)
A control number assigned by the sender to uniquely identify the interchange.
Syntax
__property String InterchangeInterchangeControlNum = { read=FInterchangeInterchangeControlNum, write=FSetInterchangeInterchangeControlNum };
Default Value
""
Remarks
A control number assigned by the sender to uniquely identify the interchange.
This is a numeric field with a value of 9 digits.
This property is not available at design time.
Data Type
String
InterchangeInterchangeControlVersionNum Property (X12Reader Component)
A code specifying the version of the X12 standard used to construct the Interchange.
Syntax
__property String InterchangeInterchangeControlVersionNum = { read=FInterchangeInterchangeControlVersionNum, write=FSetInterchangeInterchangeControlVersionNum };
Default Value
""
Remarks
A code specifying the version of the X12 standard used to construct the Interchange.
This is an alphanumeric field with a code value 5 characters.
This property is not available at design time.
Data Type
String
InterchangeReceiverID Property (X12Reader Component)
The identification code of the receiver of the transaction set.
Syntax
__property String InterchangeReceiverID = { read=FInterchangeReceiverID, write=FSetInterchangeReceiverID };
Default Value
""
Remarks
The identification code of the receiver of the transaction set.
This is an alphanumeric field with a value of 15 characters.
This property is not available at design time.
Data Type
String
InterchangeReceiverIDQualifier Property (X12Reader Component)
A code that identifies the format of the receiver ID.
Syntax
__property String InterchangeReceiverIDQualifier = { read=FInterchangeReceiverIDQualifier, write=FSetInterchangeReceiverIDQualifier };
Default Value
""
Remarks
A code that identifies the format of the receiver ID.
This is an alphanumeric field with a code value of 2 characters.
This property is not available at design time.
Data Type
String
InterchangeSecurityInfo Property (X12Reader Component)
Coded security information associated with the Interchange.
Syntax
__property String InterchangeSecurityInfo = { read=FInterchangeSecurityInfo, write=FSetInterchangeSecurityInfo };
Default Value
""
Remarks
Coded security information associated with the Interchange.
The type of information is set by the SecurityInfoQualifier.
This is an alphanumeric field with a value between of 10 characters.
This property is not available at design time.
Data Type
String
InterchangeSecurityInfoQualifier Property (X12Reader Component)
A code indicating the type of data in the Security Information property.
Syntax
__property String InterchangeSecurityInfoQualifier = { read=FInterchangeSecurityInfoQualifier, write=FSetInterchangeSecurityInfoQualifier };
Default Value
""
Remarks
A code indicating the type of data in the Security Information field.
This is an alphanumeric field with a code value of 2 characters.
This property is not available at design time.
Data Type
String
InterchangeSenderID Property (X12Reader Component)
The identification code of the sender of the transaction set.
Syntax
__property String InterchangeSenderID = { read=FInterchangeSenderID, write=FSetInterchangeSenderID };
Default Value
""
Remarks
The identification code of the sender of the transaction set.
This is an alphanumeric field with a value of 15 characters.
This property is not available at design time.
Data Type
String
InterchangeSenderIDQualifier Property (X12Reader Component)
A code that identifies the format of the sender ID.
Syntax
__property String InterchangeSenderIDQualifier = { read=FInterchangeSenderIDQualifier, write=FSetInterchangeSenderIDQualifier };
Default Value
""
Remarks
A code that identifies the format of the sender ID.
This is an alphanumeric field with a code value of 2 characters.
This property is not available at design time.
Data Type
String
InterchangeTime Property (X12Reader Component)
The time that the Interchange sets was prepared.
Syntax
__property String InterchangeTime = { read=FInterchangeTime, write=FSetInterchangeTime };
Default Value
""
Remarks
The time that the Interchange sets was prepared.
This is a numeric field with a value in the format HHMM.
This property is not available at design time.
Data Type
String
InterchangeUsageIndicator Property (X12Reader Component)
Code to indicate whether the interchange is a test or production.
Syntax
__property String InterchangeUsageIndicator = { read=FInterchangeUsageIndicator, write=FSetInterchangeUsageIndicator };
Default Value
""
Remarks
Code to indicate whether the interchange is a test or production.
This is an alphanumeric field with a code value of 1 character.
This property is not available at design time.
Data Type
String
InterchangeCount Property (X12Reader Component)
The number of Interchanges in the document.
Syntax
__property int InterchangeCount = { read=FInterchangeCount };
Default Value
0
Remarks
This property contains the number of Interchanges in the current document.
This property is read-only.
Data Type
Integer
InterchangeIndex Property (X12Reader Component)
The index of the current Interchange.
Syntax
__property int InterchangeIndex = { read=FInterchangeIndex, write=FSetInterchangeIndex };
Default Value
1
Remarks
This property is used to specify an Interchange within the document.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory, including all interchanges. You can then use InterchangeIndex to navigate to specific Interchange within the parsed document.
This property is not available at design time.
Data Type
Integer
Loop Property (X12Reader Component)
Specifies the loop to load segments from.
Syntax
__property String Loop = { read=FLoop, write=FSetLoop };
Default Value
""
Remarks
When this property is set, only segments from the specified loop and iteration will be available through the Segment properties.
A path for a loop consists of the name of the loop followed by an index indicating the iteration, like this:
reader.Loop = "N1Loop[2]";
If the loop is nested inside of another loop, the parent and child are connected by a ".":
reader.Loop = ""AK2Loop[2].AK3Loop[1]";
That can be repeated if a loop is nested more than one level deep.
This property is not available at design time.
Data Type
String
SegmentOptional Property (X12Reader Component)
Specifies whether the segment is required or optional.
Syntax
__property bool SegmentOptional = { read=FSegmentOptional };
Default Value
False
Remarks
Specifies whether the segment is required or optional. If true, the element is optional.
This property is read-only and not available at design time.
Data Type
Boolean
SegmentPath Property (X12Reader Component)
Contains the path to the segment, including the groups that the segment is contained in.
Syntax
__property String SegmentPath = { read=FSegmentPath };
Default Value
""
Remarks
Contains the path to the segment, including the groups that the segment is contained in.
This property is read-only and not available at design time.
Data Type
String
SegmentSchemaPath Property (X12Reader Component)
Contains a numeric representation of the path to the segment, using the indexes within the schema, such as \\4[3]\\5[6]\\7[8] .
Syntax
__property String SegmentSchemaPath = { read=FSegmentSchemaPath };
Default Value
""
Remarks
Contains a numeric representation of the path to the segment, using the indexes within the schema, such as \4[3]\5[6]\7[8].
This property is read-only and not available at design time.
Data Type
String
SegmentTag Property (X12Reader Component)
The tag of the segment, such as BGM , DTM , FTX , etc.
Syntax
__property String SegmentTag = { read=FSegmentTag };
Default Value
""
Remarks
The tag of the segment, such as BGM, DTM, FTX, etc.
This property is read-only and not available at design time.
Data Type
String
SegmentCount Property (X12Reader Component)
The number of segments in the current TransactionSet.
Syntax
__property int SegmentCount = { read=FSegmentCount };
Default Value
0
Remarks
This property contains the number of elements in the current TransactionSet.
This property is read-only.
Data Type
Integer
SegmentIndex Property (X12Reader Component)
This property is used to specify a Segment within the current TransactionSet .
Syntax
__property int SegmentIndex = { read=FSegmentIndex, write=FSetSegmentIndex };
Default Value
1
Remarks
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory. You can then use InterchangeIndex, FunctionalGroupIndex, TransactionSetIndex and SegmentIndex to navigate to specific Segment within the parsed document.
This property is not available at design time.
Data Type
Integer
TransSetImpConventionReference Property (X12Reader Component)
Reference used to identify the implementation convention.
Syntax
__property String TransSetImpConventionReference = { read=FTransSetImpConventionReference, write=FSetTransSetImpConventionReference };
Default Value
""
Remarks
Reference used to identify the implementation convention.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
TransSetTransactionSetControlNum Property (X12Reader Component)
The unique transaction set control number assigned for a transaction set.
Syntax
__property String TransSetTransactionSetControlNum = { read=FTransSetTransactionSetControlNum, write=FSetTransSetTransactionSetControlNum };
Default Value
""
Remarks
The unique transaction set control number assigned for a transaction set.
This is an alphanumeric field with a value between 4 and 9 characters long.
This property is not available at design time.
Data Type
String
TransSetTransactionSetIDCode Property (X12Reader Component)
The identifier code for the transaction set.
Syntax
__property String TransSetTransactionSetIDCode = { read=FTransSetTransactionSetIDCode, write=FSetTransSetTransactionSetIDCode };
Default Value
""
Remarks
The identifier code for the transaction set.
This is an alphanumeric field with a code value of 3 characters long.
This property is not available at design time.
Data Type
String
TransactionSetCount Property (X12Reader Component)
The number of TransactionSets in the current FunctionalGroup.
Syntax
__property int TransactionSetCount = { read=FTransactionSetCount };
Default Value
0
Remarks
This property contains the count of TransactionSets in the current FunctionalGroup.
This property is read-only.
Data Type
Integer
TransactionSetIndex Property (X12Reader Component)
The current TransactionSet index.
Syntax
__property int TransactionSetIndex = { read=FTransactionSetIndex, write=FSetTransactionSetIndex };
Default Value
1
Remarks
This property contains the index of the current TransactionSet within the current FunctionalGroup.
This property is not available at design time.
Data Type
Integer
ValidateOnParse Property (X12Reader Component)
When true, the component will validate any documents it parses.
Syntax
__property bool ValidateOnParse = { read=FValidateOnParse, write=FSetValidateOnParse };
Default Value
False
Remarks
When this property is set to True, the component will perform validation on the document when Parse is called. The ValidateWarning event will fire for each error it encounters.
This property is not available at design time.
Data Type
Boolean
ValidationErrorCount Property (X12Reader Component)
The number of records in the ValidationError arrays.
Syntax
__property int ValidationErrorCount = { read=FValidationErrorCount };
Default Value
0
Remarks
This property controls the size of the following arrays:
- ValidationErrorColumn
- ValidationErrorComponentIndex
- ValidationErrorElementIndex
- ValidationErrorErrorCode
- ValidationErrorErrorMessage
- ValidationErrorErrorType
- ValidationErrorFGroupIndex
- ValidationErrorInterchangeIndex
- ValidationErrorLine
- ValidationErrorPosition
- ValidationErrorSegmentIndex
- ValidationErrorSegmentTag
- ValidationErrorTransactionSetIndex
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorColumn Property (X12Reader Component)
The column number where the error occurred.
Syntax
__property int ValidationErrorColumn[int ValidationErrorIndex] = { read=FValidationErrorColumn };
Default Value
0
Remarks
The column number where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorComponentIndex Property (X12Reader Component)
This property holds the position of the component element where the error occurred.
Syntax
__property int ValidationErrorComponentIndex[int ValidationErrorIndex] = { read=FValidationErrorComponentIndex };
Default Value
1
Remarks
This property holds the position of the component element where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorElementIndex Property (X12Reader Component)
This property holds the position of the element where the error occurred.
Syntax
__property int ValidationErrorElementIndex[int ValidationErrorIndex] = { read=FValidationErrorElementIndex };
Default Value
1
Remarks
This property holds the position of the element where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorErrorCode Property (X12Reader Component)
The ErrorCode property contains the type of error encountered.
Syntax
__property String ValidationErrorErrorCode[int ValidationErrorIndex] = { read=FValidationErrorErrorCode };
Default Value
"0"
Remarks
The ValidationErrorErrorCode property contains the type of error encountered.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
String
ValidationErrorErrorMessage Property (X12Reader Component)
ErrorMessage is a textual description of the error.
Syntax
__property String ValidationErrorErrorMessage[int ValidationErrorIndex] = { read=FValidationErrorErrorMessage };
Default Value
""
Remarks
ValidationErrorErrorMessage is a textual description of the error.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
String
ValidationErrorErrorType Property (X12Reader Component)
Indicates the level of the document where the error was encountered.
Syntax
__property int ValidationErrorErrorType[int ValidationErrorIndex] = { read=FValidationErrorErrorType };
Default Value
0
Remarks
Indicates the level of the document where the error was encountered. Possible values include:
| 1 | Interchange |
| 2 | Functional group |
| 3 | Transaction set |
| 4 | Segment |
| 5 | Element |
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorFGroupIndex Property (X12Reader Component)
This property holds the position of the functional group where the error occurred.
Syntax
__property int ValidationErrorFGroupIndex[int ValidationErrorIndex] = { read=FValidationErrorFGroupIndex };
Default Value
1
Remarks
This property holds the position of the functional group where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorInterchangeIndex Property (X12Reader Component)
This property holds the position of the interchange where the error occurred.
Syntax
__property int ValidationErrorInterchangeIndex[int ValidationErrorIndex] = { read=FValidationErrorInterchangeIndex };
Default Value
1
Remarks
This property holds the position of the interchange where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorLine Property (X12Reader Component)
The line number where the error occurred.
Syntax
__property int ValidationErrorLine[int ValidationErrorIndex] = { read=FValidationErrorLine };
Default Value
0
Remarks
The line number where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorPosition Property (X12Reader Component)
This property holds the byte position in the EDI stream where the error occurred.
Syntax
__property __int64 ValidationErrorPosition[int ValidationErrorIndex] = { read=FValidationErrorPosition };
Default Value
0
Remarks
This property holds the byte position in the EDI stream where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Long64
ValidationErrorSegmentIndex Property (X12Reader Component)
This property is the index of the segment where the error occurred.
Syntax
__property int ValidationErrorSegmentIndex[int ValidationErrorIndex] = { read=FValidationErrorSegmentIndex };
Default Value
1
Remarks
This property is the index of the segment where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
ValidationErrorSegmentTag Property (X12Reader Component)
This property specifies the tag name of the segment where the error occurred.
Syntax
__property String ValidationErrorSegmentTag[int ValidationErrorIndex] = { read=FValidationErrorSegmentTag };
Default Value
""
Remarks
This property specifies the tag name of the segment where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
String
ValidationErrorTransactionSetIndex Property (X12Reader Component)
This property holds the position of the message where the error occurred.
Syntax
__property int ValidationErrorTransactionSetIndex[int ValidationErrorIndex] = { read=FValidationErrorTransactionSetIndex };
Default Value
1
Remarks
This property holds the position of the message where the error occurred.
The ValidationErrorIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ValidationErrorCount property.
This property is read-only and not available at design time.
Data Type
Integer
Config Method (X12Reader Component)
Sets or retrieves a configuration setting.
Syntax
String __fastcall Config(String ConfigurationString);
Remarks
Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, 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.
GenerateAck Method (X12Reader Component)
Generates an ACK in response to the most recently parsed TransactionSet.
Syntax
String __fastcall GenerateAck();
Remarks
After parsing a TransactionSet, call this method to generate an ACK that you can send back in response. The type of ACK generated can be controlled by setting the AckType property.
GetElementValue Method (X12Reader Component)
Returns the value of the element or component at the specified path.
Syntax
String __fastcall GetElementValue(String Path);
Remarks
This method returns the value of the element at the specified path. The path starts at the current Message and consists of loops (with indexes to indicate the iteration), a segment tag, and 1-2 indexes to indicate the element or component.
For a simple element the path should include the path to a specific iteration of a loop (as in the Loop property), followed by a segment tag and an index for the element position within the segment, each separated by a ".":
reader.GetElementValue("N1Loop[2].N4.4");
When selecting a component of a composite element, the component index should be added after the element index:
reader.GetElementValue("AK2Loop[2].AK3Loop[1].AK4.1.1");
LoadSchema Method (X12Reader Component)
Loads schema information from a file or string data.
Syntax
void __fastcall LoadSchema(String fileOrData, String messagename);
Remarks
This method loads schema information for use when parsing, validating, and translating messages.
The FileOrData parameter can be set to the path of a file containing schema data, or can be set to the contents of a schema file directly.
MessageName can be set to the name of a specific message to load only the specified message's schema information. If left empty or set to "*", the entire schema will be loaded.
Parse Method (X12Reader Component)
Parse the EDI document and fire parsing events.
Syntax
void __fastcall Parse();
Remarks
This method parses the input EDI document, firing the following events as it parses:
- StartInterchange
- StartFunctionalGroup
- ResolveSchema
- StartTransactionSet
- StartLoop
- Segment
- EndLoop
- EndTransactionSet
- EndFunctionalGroup
- EndInterchange
When multiple input sources are specified, only the highest-priority input will be used, in the following order:
Reset Method (X12Reader Component)
Sets the component to its initial state.
Syntax
void __fastcall Reset();
Remarks
When called the component clears all inputs and outputs, and resets all properties to their default values.
SchemaCode Method (X12Reader Component)
Defines a code value within a list of codes.
Syntax
void __fastcall SchemaCode(String SchemaId, String CodeListId, String Value, String Description);
Remarks
Creates a schema definition for a code value within a particular list of codes.
This method can be used when defining a schema instead of loading one from a file.
SchemaCodeList Method (X12Reader Component)
Defines a list of codes.
Syntax
void __fastcall SchemaCodeList(String SchemaId, String CodeListId, String Description);
Remarks
Creates a schema definition for an empty list of codes. SchemaCode can be used to add code values to the list.
This method can be used when defining a schema instead of loading one from a file.
SchemaComposite Method (X12Reader Component)
Defines a composite element.
Syntax
void __fastcall SchemaComposite(String SchemaId, String CompositeId, String Description);
Remarks
Creates a schema definition for a composite element. SchemaElementRef can be used to add components to the element.
This method can be used when defining a schema instead of loading one from a file.
SchemaElement Method (X12Reader Component)
Defines a simple element.
Syntax
void __fastcall SchemaElement(String SchemaId, String ElementId, String DataType, int MinLength, int MaxLength, String CodeId, String Description);
Remarks
Creates a schema definition for a simple element.
This method can be used when defining a schema instead of loading one from a file.
SchemaElementRef Method (X12Reader Component)
Adds a reference to an element in a segment or composite element.
Syntax
void __fastcall SchemaElementRef(String SchemaId, String ParentId, String ElementId, String RefId, bool Required, int MaxCount);
Remarks
Adds a reference to an element to the specified parent, which can be the most recently defined segment or composite element.
This method can be used when defining a schema instead of loading one from a file.
SchemaEnd Method (X12Reader Component)
Ends a schema definition.
Syntax
void __fastcall SchemaEnd();
Remarks
Ends a schema definition when a schema is being defined manually instead of loaded from a file.
SchemaGroup Method (X12Reader Component)
Defines a group of segments.
Syntax
void __fastcall SchemaGroup(String SchemaId, String GroupPath, String GroupId, bool Required, int MaxCount);
Remarks
Creates a schema definition for a group of segments. SchemaSegmentRef can be used to add references to defined segments.
This method can be used when defining a schema instead of loading one from a file.
SchemaMessage Method (X12Reader Component)
Defines a message.
Syntax
void __fastcall SchemaMessage(String SchemaId, String MessageId, String Description);
Remarks
Creates a schema definition for a message. SchemaSegmentRef and SchemaGroup can be used to add segment references and groups to the message.
This method can be used when defining a schema instead of loading one from a file.
SchemaSegment Method (X12Reader Component)
Defines a segment.
Syntax
void __fastcall SchemaSegment(String SchemaId, String SegmentId, String Description);
Remarks
Creates a schema definition for a segment. SchemaElementRef can be used to add component references to the segment.
This method can be used when defining a schema instead of loading one from a file.
SchemaSegmentRef Method (X12Reader Component)
Adds a reference to a segment in a message or group.
Syntax
void __fastcall SchemaSegmentRef(String SchemaId, String SegmentPath, String SegmentId, bool Required, int MaxCount);
Remarks
Adds a reference to a segment to the specified path.
This method can be used when defining a schema instead of loading one from a file.
SchemaStart Method (X12Reader Component)
Starts a schema definition.
Syntax
void __fastcall SchemaStart(String SchemaId);
Remarks
Starts manually defining a schema, as an alternative to loading one from a file.
Validate Method (X12Reader Component)
Validate the EDI document and warn about any errors encountered.
Syntax
void __fastcall Validate();
Remarks
This method parses the input EDI document, firing the ValidateWarning event for any non-blocking errors it encounters.
EndFunctionalGroup Event (X12Reader Component)
Fires at the end of a functional group while parsing.
Syntax
typedef struct {
String Tag;
int TransactionCount;
String ControlNumber;
} TedX12ReaderEndFunctionalGroupEventParams;
typedef void __fastcall (__closure *TedX12ReaderEndFunctionalGroupEvent)(System::TObject* Sender, TedX12ReaderEndFunctionalGroupEventParams *e);
__property TedX12ReaderEndFunctionalGroupEvent OnEndFunctionalGroup = { read=FOnEndFunctionalGroup, write=FOnEndFunctionalGroup };
Remarks
This event fires when the component encounters the end of a functional group while parsing a document.
EndInterchange Event (X12Reader Component)
Fires at the end of a interchange while parsing.
Syntax
typedef struct {
String Tag;
int GroupCount;
String ControlNumber;
} TedX12ReaderEndInterchangeEventParams;
typedef void __fastcall (__closure *TedX12ReaderEndInterchangeEvent)(System::TObject* Sender, TedX12ReaderEndInterchangeEventParams *e);
__property TedX12ReaderEndInterchangeEvent OnEndInterchange = { read=FOnEndInterchange, write=FOnEndInterchange };
Remarks
This event fires when the component encounters the end of a interchange while parsing a document.
EndLoop Event (X12Reader Component)
Fires at the end of a loop while parsing.
Syntax
typedef struct {
String Name;
int Index;
} TedX12ReaderEndLoopEventParams;
typedef void __fastcall (__closure *TedX12ReaderEndLoopEvent)(System::TObject* Sender, TedX12ReaderEndLoopEventParams *e);
__property TedX12ReaderEndLoopEvent OnEndLoop = { read=FOnEndLoop, write=FOnEndLoop };
Remarks
This event fires when the component encounters the end of a loop while parsing a document.
EndTransactionSet Event (X12Reader Component)
Fires at the end of a transaction set while parsing.
Syntax
typedef struct {
String Tag;
int SegmentCount;
String ControlNumber;
} TedX12ReaderEndTransactionSetEventParams;
typedef void __fastcall (__closure *TedX12ReaderEndTransactionSetEvent)(System::TObject* Sender, TedX12ReaderEndTransactionSetEventParams *e);
__property TedX12ReaderEndTransactionSetEvent OnEndTransactionSet = { read=FOnEndTransactionSet, write=FOnEndTransactionSet };
Remarks
This event fires when the component encounters the end of a transaction set while parsing a document.
Error Event (X12Reader Component)
Fires when a parsing error occurs.
Syntax
typedef struct {
int ErrorCode;
String Description;
} TedX12ReaderErrorEventParams;
typedef void __fastcall (__closure *TedX12ReaderErrorEvent)(System::TObject* Sender, TedX12ReaderErrorEventParams *e);
__property TedX12ReaderErrorEvent OnError = { read=FOnError, write=FOnError };
Remarks
This event fires when the component encounters a parsing error while processing a document.
ResolveSchema Event (X12Reader Component)
Fires to request schema information for a specific transaction set.
Syntax
typedef struct {
String VersionNumber;
String TransactionSetIDCode;
} TedX12ReaderResolveSchemaEventParams;
typedef void __fastcall (__closure *TedX12ReaderResolveSchemaEvent)(System::TObject* Sender, TedX12ReaderResolveSchemaEventParams *e);
__property TedX12ReaderResolveSchemaEvent OnResolveSchema = { read=FOnResolveSchema, write=FOnResolveSchema };
Remarks
LoadSchema can be called from within this event to load the schema information for the specified transaction set.
Segment Event (X12Reader Component)
Fires at the end of a Segment while parsing.
Syntax
typedef struct {
String Tag;
String SchemaPath;
bool Optional;
int ElementCount;
int SchemaIndex;
int SegmentIndex;
int MaxCount;
String Path;
} TedX12ReaderSegmentEventParams;
typedef void __fastcall (__closure *TedX12ReaderSegmentEvent)(System::TObject* Sender, TedX12ReaderSegmentEventParams *e);
__property TedX12ReaderSegmentEvent OnSegment = { read=FOnSegment, write=FOnSegment };
Remarks
Fires at the end of a Segment while parsing a document with the Parse method. The parameters provide information about the segment that was just parsed: Tag: The segment tag (e.g., "ISA", "GS", "ST", etc.).
SchemaPath: The schema path for the segment, if schema information is available.
Optional: A boolean indicating whether the segment is optional (true) or required (false) according to the schema.
ElementCount: The number of elements in the segment.
SchemaIndex: The index of the segment in the schema, if schema information is available.
SegmentIndex: The index of the segment within the current transaction set.
MaxCount: The maximum number of times this segment can occur in the current context, according to the schema.
Path: The full path to the segment within the message structure.
StartFunctionalGroup Event (X12Reader Component)
Fires at the beginning of a functional group while parsing.
Syntax
typedef struct {
String Tag;
String AppSenderCode;
String AppReceiverCode;
String DateTime;
String ControlNumber;
} TedX12ReaderStartFunctionalGroupEventParams;
typedef void __fastcall (__closure *TedX12ReaderStartFunctionalGroupEvent)(System::TObject* Sender, TedX12ReaderStartFunctionalGroupEventParams *e);
__property TedX12ReaderStartFunctionalGroupEvent OnStartFunctionalGroup = { read=FOnStartFunctionalGroup, write=FOnStartFunctionalGroup };
Remarks
This event fires when the component encounters the start of a functional group while parsing a document.
StartInterchange Event (X12Reader Component)
Fires at the beginning of an interchange while parsing.
Syntax
typedef struct {
String Tag;
String SenderID;
String ReceiverID;
String DateTime;
String ControlNumber;
} TedX12ReaderStartInterchangeEventParams;
typedef void __fastcall (__closure *TedX12ReaderStartInterchangeEvent)(System::TObject* Sender, TedX12ReaderStartInterchangeEventParams *e);
__property TedX12ReaderStartInterchangeEvent OnStartInterchange = { read=FOnStartInterchange, write=FOnStartInterchange };
Remarks
This event fires at the beginning of an interchange while parsing a document.
StartLoop Event (X12Reader Component)
Fires at the beginning of a loop while parsing a transaction set.
Syntax
typedef struct {
String Name;
int Index;
int MaxCount;
String Path;
} TedX12ReaderStartLoopEventParams;
typedef void __fastcall (__closure *TedX12ReaderStartLoopEvent)(System::TObject* Sender, TedX12ReaderStartLoopEventParams *e);
__property TedX12ReaderStartLoopEvent OnStartLoop = { read=FOnStartLoop, write=FOnStartLoop };
Remarks
This event fires when the component encounters the start of a loop while parsing a transaction set.
StartTransactionSet Event (X12Reader Component)
Fires at the beginning of a transaction set while parsing.
Syntax
typedef struct {
String Tag;
String VersionNumber;
String TransactionSetIDCode;
String ControlNumber;
bool SchemaLoaded;
} TedX12ReaderStartTransactionSetEventParams;
typedef void __fastcall (__closure *TedX12ReaderStartTransactionSetEvent)(System::TObject* Sender, TedX12ReaderStartTransactionSetEventParams *e);
__property TedX12ReaderStartTransactionSetEvent OnStartTransactionSet = { read=FOnStartTransactionSet, write=FOnStartTransactionSet };
Remarks
This event fires when the component encounters the start of a transaction set while parsing a document.
ValidateWarning Event (X12Reader Component)
Fires to warn about validation errors.
Syntax
typedef struct {
__int64 Position;
int Line;
int Column;
String ErrorCode;
String ErrorMessage;
int ErrorType;
} TedX12ReaderValidateWarningEventParams;
typedef void __fastcall (__closure *TedX12ReaderValidateWarningEvent)(System::TObject* Sender, TedX12ReaderValidateWarningEventParams *e);
__property TedX12ReaderValidateWarningEvent OnValidateWarning = { read=FOnValidateWarning, write=FOnValidateWarning };
Remarks
When the component encounters a non-blocking error while validating a document, this event fires with information about the error.
Config Settings (X12Reader Component)
The component 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 component, access to these internal properties is provided through the Config method.X12Reader Config Settings
| 0 (default) | X12 |
| 1 | XML |
Trappable Errors (X12Reader Component)
X12Reader Errors
| 202 | Invalid argument. |
| 304 | Cannot write to file. |
| 1003 | Could not find the selected schema in the chosen file. |
| 1099 | Encountered an unexpected segment tag. |
| 1100 | Attempted to perform an action while the component was busy, or close an incomplete interchange. |
| 1044 | Tried to load an invalid schema file. |
| 1201 | The index is out of range. |
| 1202 | The selected ACK type is invalid. |
| 1204 | Encountered an error while validating the ISA segment. |