Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter ElevenSGML Functions (continued)

HTMLContextScan Function

Overview

The HTMLContextScan performs a context scan of the file associated with HTML Context Object.

Syntax/Parameters

Syntax

int = HTMLContextScan ( handle hObject,
                   [int s_x, int s_y, [int e_x, int e_y ]], [dword flags] );

Parameters

hObject

A handle to an HTML Context Object.

s_x  s_y

Two int values specifying the start position of the scan.

e_x  e_y

Two int values specifying the end position of the scan, also known as the point of interest.

flags

An optional dword specifying what items to track as the file is scanned. If the value is zero or omitted, only the context stack is built.

Return Value

An int as a formatted error code. Use the GetLastErrorMessage function to retrieve additional information. The GetLastError message can be used to retrieve additional scan information.

Remarks

The scan function allows for lists to be built and a context to be developed. Context scanning only applies to an HTML Context Object. If a context object is not provided to functions such as HTMLGetNames, the context scan is automatically run on each call.

Generally, HTMLContextScan is used by specifying the start of the file (0,0) and then a point of interest, for example a table cell. The scanner will stop at the point of interest and the stack may be examined with the HTMLGetContext function. If a section is to be scanned, then the starting position should be set to that point.

The flags parameter is a bitwise value which may consist of the following values:

  SDK Definition   Bitwise   Description  
  HFS_GET_STACK_ONLY   0x00000000   No flags, loads only context stack.  
  HFS_GET_NAME_SPACE   0x00000001   Track NAME Space  
  HFS_GET_URI_REFERENCE   0x00000002   Track URI References  
  HFS_GET_CLASS   0x00000004   Track CLASS References  
  HFS_GET_OBJECTS   0x00000008   Track Object/Image Definitions  
  HFS_GET_FIELD   0x00000010   Track Marker Definitions  
  HFS_GET_FONTS   0x00010000   Track Font References  
  HFS_GET_COLORS   0x00020000   Track Color References  

 

At the end of the scan, additional information is returned in a bitwise for within the last error code.

  SDK Definition   Bitwise   Description  
  HFS_RESULT_NESTING   0x00100000   File Contains Stack/Nesting Error(s)  
  HFS_RESULT_MID_ENTITY   0x00200000   Stopped Mid Entity  
  HFS_RESULT_MID_ELEMENT   0x00400000   Stopped Mid Element  
  HFS_RESULT_NOT_VALID_POINT   0x00600000   Combine Above  

 

Note that the HTMLGetContext function will reset the last data range position to the specified positions in the parameters. If a shared SGML Object is employed, make sure the data range and scan positions are reset prior to using the parser.

Related Functions

Platform Support

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

Legato IDE, Legato Basic