EDIFACT Integrator - Online Help
EDIFACT Integrator
Questions / Feedback?

Input Method

Provides input to the parser.

Syntax

edifactreader.input(text, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

The parser gets the text input via the Text parameter. The Text is sent to the parser's state machine and appropriate events are fired as a result of the parsing process.

The events are fired only when qualifying conditions (such as, for example, a new segment) are met. In the meantime, text will be buffered internally.

When the parser is finally reset via the Reset method, all buffered text is flushed out through the ExtraData property.

Since the class can be used to parse EDI data fragments, the internal buffer will not be cleared until Reset is called. If you plan to use this method to parse multiple complete EDI documents be sure to call Reset between calls.

Example (Parse an EDI File)


EDIReaderControl.Input("edidata")

 
 
Copyright (c) 2018 /n software inc. - All rights reserved.
Build 1.0.6635.0