Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter SixFile Functions (continued)

InsertLine Function

Overview

The InsertLine function will insert a line of text into a Mapped Text Object.

Syntax/Parameters

Syntax

int = InsertLine ( handle hMappedText, int index, string text );

Parameters

hMappedText

A handle to a valid Mapped Text Object.

index

An int containing the zero-based index of the line before which the data will be inserted. If the value is -1, the text is appended to the end of the object. A value of 0 inserts the text at the start of the object.

text

A string containing up to 1,048,575 characters to insert. The string must not contain control characters, such as return (“\r”) or new line (“\n”).

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure. Use the GetLastError function to retrieve error information.

Remarks

The InsertLine function is a low-level function and therefore should not be used in conjunction with more complex editing features, such as when the Mapped Text Object is used with the transaction process. This function should also not be used with Mapped Text Objects retrieved from edit windows where using transactions is essential in enabling editing abilities such as undo. In these cases, use segment functions to adjust the text within the Mapped Text Object, such as the ReadSegment or WriteSegment functions.

If the hMappedText parameter is invalid, the GetLastError function will return ERROR_INVALID_HANDLE.

Related Functions

Platform Support

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

Legato IDE, Legato Basic