Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter EightData Functions (continued)

DataSheetImport Function

Overview

The DataSheetImport function imports the content of a data sheet as XML (XML Data Sheet, XDS, format) or CSV.

Syntax/Parameters

Syntax

int = DataSheetImport ( handle hSheet, string filename, [int sheet], [dword flags] );

Parameters

hSheet

A handle to a Data Sheet Object.

filename

A string as a fully qualified filename and path for the source data.

sheet

An optional int specifying the zero-based sheet position to load. The position is measured by the order of the sheets, not the index set in the sheet properties (as specified by the <s> tag in the XML).

flags

An optional dword specifying options for import. The default is 0x00000000.

Return Value

An int as ERROR_NONE (0) or a formatted error code. Use the GetLastErrorMessage to get the first error in the log.

Remarks

See the Appendix B — XML Data Sheet Format Specification for additional information.

File format selection is based on the file extension. If the extension is “.csv”, CSV import is selected. If the extension is “.dat”, it is assumed to be a delimited file as tabs, vertical bars, semicolons or commas. All other types are assumed to be XML.

The CSV import will detect if a file has a UTF-8 header, if none is present, it will convert the CSV fields from ANSI to Unicode characters and encoded as UTF-8. If the incoming source is 16-bit Unicode, the content is parsed as encoded as UTF-8.

The flags support DS_IMPORT_USE_PROGRESS which allows an open progress window to be attached. The import will range from 1-99%, as such phases should be used if the script requires more actions than just a simple import.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic