Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SixFile Functions (continued)

GetAbsoluteFilePosition Function

Overview

The GetAbsoluteFilePosition returns the byte position within a Mapped Text Object as specified by an x (column) and y (row) position.

Syntax/Parameters

Syntax

int = GetAbsoluteFilePosition ( handle hObject, int x, int y );

Parameters

hObject

A handle to a valid Mapped Text or Edit Object.

x

An int containing an x position (column) within the Mapped Text Object.

y

An int containing an y position (row) within the Mapped Text Object.

Return Value

Returns an int containing the byte position corresponding to x and y or -1 on failure. Use the GetLastError function to retrieve error information.

Remarks

The GetAbsoluteFilePosition function returns a byte position corresponding to the x and y parameters within a Mapped Text Object. The value for the x parameter is not checked to be within range; it is simply added to the summation of bytes for each line up to the y parameter to produce a location. This function assumes that string or file from which the Mapped Text Object was created had line endings (“/r/n”) between each line. This function also assumes the text within the source file still matches the text within the Mapped Text Object, and they could differ significantly depending on the editing actions performed on either.

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