Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter SixFile Functions (continued)

ReadSegment Function

Overview

The ReadSegment function reads a segment from a Mapped Text or Edit Object.

Syntax/Parameters

Syntax

string = ReadSegment ( handle hObject, [int sx, int sy, int ex, int ey] );

Parameters

hObject

A handle to a Mapped Text, Edit Object or an Edit View. For Mapped Text objects, the position parameters must be provided. For Edit Objects, the position parameter can be omitted if the select mode is linear and the positions will default to the selected area.

sx

An int specifying the native X position in the file from which to start the read.

sy

An int specifying the Y position in the file from which to start the read.

ex

An int specifying the native X position in the file at which the read will stop.

ey

An int specifying the Y position in the file at which the read will stop.

Return Value

Returns a string containing the specified region of text or an empty string on failure. Use GetLastError to retrieve error information.

Remarks

The maximum size of a line is 1,048,575 characters. Note that an empty string may not necessarily indicate an error occurred. The last error may also contain non-error information, which means checking the last error against zero is an invalid test. Use the IsError or IsNotError functions to determine if an error occurred.

Values are native. Line returns are represented by a single 0x0D character.

Related Functions

Platform Support

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

Legato IDE, Legato Basic