Parse a TextLineResult
MICR Xpress provides the capability to parse a TextLineResult into MICR fields defined by ASC X9, Inc. The field definitions that MICR Xpress uses are defined in the standards document ASC X9.100-160-1-2004. The supported fields from this document are Amount, Auxiliary On-Us, EPC, On-Us, and Routing.
When parsing, MICR Xpress treats a text line result as if it were the complete MICR line from a check. At a minimum, this line must consist of a Routing and On-Us field. Other fields may be present, but the line must preserve the format and order defined by the supported standards. If attempting to parse a TextLineResult that does not represent a well-formed MICR line, a status indicating InvalidFormat will be returned.
The methods and properties of the TextLineResult and MICRFieldResult that will allow you to parse a text line and access parsing results are tabulated in the following topics:
Use the following guidelines to parse a TextLineResult:
- Perform recognition on the specified image using one of the AnalyzeField methods.
- Select the text line to be parsed using the TextBlockResultSelectTextLine method.
- Check for rejection characters in the text line by iterating through the character results in the text line and checking the CharacterResultText method. The parser will not be able to parse any text that includes non-MICR characters. See Check for Rejection Character.
- If rejection characters are found, determine the appropriate action for your application.
- Perform parsing with the ParseTextLine method. If this method fails to parse the text line, it is because the text line does not interpret into a well formed MICR line, and then the method will return the error status (or throw an exception) MX_ErrorCode_InvalidFormat.
- Determine which fields were parsed using the TextLineResultParseableFields property. This property gets a single value indicating which of the fields were parsed. To determine if a specific field was parsed, mask that field with the MX_FieldType enumeration value.
- Access a specific MICR field using the TextLineResultSelectMICRField method. This method should pass the value of the MICR field type you select. Repeat this step for each field you want to select.
| VB Example | Copy Code |
|---|---|
|
micrXpress.AnalyzeField myHDib micrXpress.TextBlockResultSelectTextLine 1 ' check for rejection character intentionally left out to condense example code micrXpress.ParseTextLine Dim fieldType As MX_FieldType fieldType = MX_FieldType_Amount If ((fieldType And micrXpress.TextLineResultParseableFields) = fieldType) Then micrXpress.TextLineResultSelectMICRField fieldType ' access the attributes of the selected field here End If | |
