Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter ElevenSGML Functions (continued)

SGMLPreviousElement Function

Overview

The SGMLPreviousElement function moves the parser backward until an SGML tag (element) is found. An optional start position can be provided. By default, the parse continues backward from the current position.

Syntax/Parameters

Syntax

string = SGMLPreviousElement ( handle hSGML, [int x, int y] );

Parameters

hSGML

A handle to an SGML object.

x

An optional int value specifying the zero-based X position to parse from. The position is native. When provided, the Y position must also be provided. If omitted, the function parses from the current position.

y

An optional int value specifying the zero-based Y position to parse from. The X position must be provided with this parameter.

Return Value

A string containing the tag’s text, an empty string on error. Use the GetLastError function to retrieve an error code.

Remarks

The SGMLPreviousElement skips all spaces, character entities and PCDATA to get to the previous element. If the end of data is reached prior to a tag, an empty string is returned and ERROR_EOD will be placed in the last error buffer.

The current position, properties and other characteristics are made available through various ‘get’ functions.

Since SGMLPreviousElement only reads tags, the element attributes/properties are loaded into the SGML Object.

Related Functions

Platform Support

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

Legato IDE, Legato Basic