ErrorLineNumber Property


ErrorLineNumber Property

Location

TextFieldParser.ErrorLineNumber

Syntax

     Dim fileParser As FileIO.TextFieldParser         ' ...later...     Dim result As Long = fileParser.ErrorLineNumber 

Description

The ErrorLineNumber property returns the line number of the most recent data input line that could not be parsed by the TextFieldParser object. Failed parsing is indicated by the Microsoft.VisualBasic.FileIO.MalformedLineException exception being thrown during a read operation. The ErrorLine property returns the text of the errant line.

Usage at a Glance

  • This property is read-only.

  • The first line in the file is line number 1.

  • Blank lines and comment lines are counted as valid lines when determining the line position.

  • In the absence of malformed line errors, this property returns -1.

  • You must close the TextFieldParser object when finished with it. Use the object's Close method or create the object instance with the Using keyword. See the TextFieldParser Object entry in this chapter for an example.

Example

See the example in the ErrorLine Property entry.

Related Framework Entries

  • Microsoft.VisualBasic.FileIO.TextFieldParser.ErrorLineNumber Property

See Also

EndOfData Property, ErrorLine Property, LineNumber Property, ReadFields Method, TextFieldParser Object




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net