Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter EightData Functions (continued)

FormattedTextToArray Function

Overview

The FormattedTextToArray function takes an incoming formatted string and divides it into elements which are then placed into a string array.

Syntax/Parameters

Syntax

string[] = FormattedTextToArray ( string data, int positions[] );

Parameters

data

A string containing the source data to parse into array elements.

positions

An array of ints specifying the positions to capture the text data. Each entry specifies the ending position of the area of the data string to place into the resulting string array. The last entry in the array should be beyond the expected largest string in data. If in doubt, set the last value to 0 and it will be translated automatically to 0x7FFFFFFF.

Return Value

Returns an array of strings or an empty array on failure. Use the GetLastError function to retrieve additional data.

Remarks

There will be a corresponding resultant string entry for every entry in the position array. If the source string is exhausted prior to processing all the positions, the corresponding array entries will be empty strings. Resulting data elements are trimmed for trailing spaces but not for leading spaces. A maximum size of 1,048,575 characters is allowed for each resulting data array element.

The positions are not tab-adjusted in the source string. If the source string contains tabs, they are counted as a single character which will probably result in erroneous results. Other common errors are usually related to positioning issues.

Related Functions

Platform Support

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

Legato IDE, Legato Basic