Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter FiveGeneral Functions (continued)

WordsToArray Function

Overview

The WordsToArray function parses a buffer for words and loads them into a list.

Syntax/Parameters

Syntax

string[] = WordsToArray ( string data, [dword flags] );

Parameters

data

A string specifying the source data.

flags

An optional dword specifying the parse options. If omitted, the value is WP_GENERAL. The flag values are as follows.

  WP_GENERAL 0 General – stops on word spaces.
  WP_SGML_TAG 1 Tags – stops on tags (SGML, HTML, and XML).
  WP_PROGRAM 2 Program – stops on typical programmatic expressions.
  WP_PROGRAM_GROUP 3 Program Groups – same as mode 2 but returns complete groups for parenthesis (‘( )’), brackets (‘[ ]’), single quotes (‘ ' ' ’), and double quotes (‘ " " ’).
  WP_OBJECT_NOTATION 5 Object Notation — Stops on delimiters commonly used on object references such as ‘.’ ‘[‘ and ‘]’.

 

Return Value

Returns a string array containing the words or empty on failure. Use the GetLastError function to retrieve error and processing information.

If the result is zero items, the last error will be ERROR_EOD. If an item overflows the internal buffer, the result will be ERROR_OVERFLOW, see remarks below. Otherwise the last error will contain the count of the items added.

Remarks

The WordsToArray functions explodes a buffer of text using the Word Parse Object and places the result into a list.

The internal word buffer is limited to 1024 characters. Should a parsed string item be larger, the function will return an overflow error.

The internal word buffer is limited to 1024 characters. Should a parsed string item be larger, the function will mark the first overflow and set an error condition on exit. If the source cannot be controlled, it is best to use the GetLastError function to determine if an overflow occurred and its first index location. If multiple overflows occur, only the first item is returned in the last error code.

Related Functions

Platform Support

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

Legato IDE, Legato Basic