Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter FiveGeneral Functions (continued)

WordParseCreate Function

Overview

The WordParseCreate function creates a Word Parse Object.

Syntax/Parameters

Syntax

handle = WordParseCreate ( [dword mode], [string data] );

Parameters

dword

An optional int flag specifying how the Word Parse Object will parse the buffer. The options are as follows:

  WP_GENERAL General – stops on word spaces.
  WP_SGML_TAG Tags – stops on tags (SGML, HTML, and XML).
  WP_PROGRAM Program – stops on typical programmatic expressions.
  WP_PROGRAM_GROUP

Program Groups – same WP_PROGRAM but returns complete groups for:

( )   parenthesis

[ ]   brackets

' '    single quotes

" "   double quotes

  WP_TAG_ENCAPSULATE  Tags Encapsulate Data — Special Adobe Mode for parsing XML with nested quotes, tags nested inside of tags and backslash escaped characters.
  WP_OBJECT_NOTATION Object Notation — Stops on delimiters commonly used on object references such as ‘.’ ‘[‘ and ‘]’.

 

If mode is not set, the function will default to WP_GENERAL (general space based word parsing).  Additional option bits can be ORed in:

  WP_BIG_WORD_BUFFER Forces the use of a 2MB word parse buffer instead of the default 4KB buffer.
  WP_PROGRAM_AUGMENTED_QUOTES In program parse group mode, allows the use of L and R prefix designations on strings.

 

data

An optional string that the Word Parse Object can parse. If the data parameter is provided, the mode parameter must also be provided.

Return Value

Returns a handle to a word parse object or 0 on failure. Use the GetLastError function to retrieve error information.

Remarks

The WordParseCreate function should be called first to create a Word Parse Object. The handle returned by this function should be used in all subsequent function calls involving that Word Parse Object. A string to parse can be supplied at the time of creation or later with the WordParseSetData function. The mode must be specified at the time of creation and it cannot be changed afterward; to parse a string differently, a separate Word Parse Object must be created.

To move through the data buffer, use the WordParseGetWord function. The leading white space buffer for each word is limited to 256 characters. The Word Parse Object should be released with the CloseHandle function.

Related Functions

Platform Support

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

Legato IDE, Legato Basic