<CCSV>.Root

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > CSV > cCSV class > <cCSV> constructor > <cCSV> properties >

<CCSV>.Root

 

Description

 

Retrieve errors information occurred during object handling.

 

Syntax

 

nCol = <cCSV>.Errors[(nErrorCode)]

 

Returns

 

Number

Total number of errors occurred or total number of specific error code occurred

 

Parameters

 

Name

Type

Optional

Meaning

nErrorCode

Number

Yes

If no parameter is specified, property will return total number of errors occurred so far into the CCSV object.

 

If a specific error code is specified, property will return total number of specific error type occurred  so far into the CCSV object.

 

Please use one of the following specific error codes:

 

%CSV_Error_FileNotFound

 

%CSV_Error_Data_Access_Outside_Column_Limits

 

%CSV_Error_Data_Access_Outside_Row_Limits

 

 

Remarks

 

It is a good idea to check this property in order to make sure any possible error is detected.

 

Restrictions

 

See also

 

Examples

 

uses "CSV", "console"

 

dim data as new cCSV

data.Load(APP_ScriptPath + "NonExistingFile.csv"True)  ' Intentionally wrong filename

 

printl $("Data of cell at row a, column 3: '{data.Column.Data(2, 3)}'")

 

printl "Testing errors"

printl $("Number of run time errors occurred: {data.Errors}")

if data.Errors > 0 Then

  printl $("%CSV_Error_Type_FileNotFound                      {data.Errors(%CSV_Error_Type_FileNotFound)}")

  printl $("%CSV_Error_Type_Data_Access_Outside_Column_Limits {data.Errors(%CSV_Error_Type_Data_Access_Outside_Column_Limits)}")

  printl $("%CSV_Error_Type_Data_Access_Outside_Row_Limits    {data.Errors(%CSV_Error_Type_Data_Access_Outside_Row_Limits)}")

end If

 

waitkey