Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter EightData Functions (continued)

TableToText Function

Overview

The TableToText function exports the content of a table to text with tabs. The function can return a string, write to a file or store in a Pool object.

Syntax/Parameters

Syntax

string = TableToText ( string[][] table, [dword flags], [string file | handle pool );

Parameters

table

An array of string data which must resolve to two-dimensions.

flags

An optional dword specifying the options to use while creating the data. The default value is write the key names as a header (TTT_KEY_NAMES_TO_HEADER).

file

An optional string specifying a destination filename and path to write the resulting data. This parameter cannot be used with the pool parameter.

pool

An optional handle to a Pool object to place the resulting data. This parameter cannot be used with the file parameter.

Return Value

Returns a string as the result or empty string on failure. Use the GetLastError function to retrieve error information. The GetLastErrorMessage function can return additional error information.

If the file or pool parameter is used, the result will be “OK” if the function succeeds with the result placed in the specified destination.

Remarks

The TableToText takes the context of a table and writes it as tab (0x09) delimited rows and rows delimited by line endings. It is important to note that is the table contains strings with tab characters, it will create an ambiguous field results.

The flags options are as follows (type can be ORed with options):

  Term   Code   Description  
  TTT_CRLF_LINE_ENDING   0x00000000   Line ending as CR/LF (absence of flag)  
  TTT_SIMPLE_LINE_ENDING   0x00000001   Use CR only line endings  
  TTT_KEY_NAMES_TO_HEADER   0x00000002   Convert key names to as first row  
  TTT_ADD_UTF_8_HEADER   0x00000008   Add UTF-8 header/prefix  

 

Related Functions

Platform Support

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

Legato IDE, Legato Basic