Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

GetStringFromQuotes Function

Overview

The GetStringFromQuotes function retrieves a string (filename) from a quoted string or from a command line style string.

Syntax/Parameters

Syntax

string = GetStringFromQuotes ( string data, [boolean parse] );

Parameters

source

A string from which to get a string segment.

parse

An optional boolean value indicating that the function is parsing items. The default value is FALSE. See Remarks below.

Return Value

Returns a string containing the segment of source or an empty string on failure. If the data is not quoted, it is simply returned as is. Use the GetLastError function to retrieve error information.

On success and if the parse flag is set, the last error code will contain the next non-space item or last position in the source string.

Remarks

The GetStringFromQuotes function is principally designed for processing filename parameters either from command-line data or from dialog boxes. For example, if a filename is copied from explorer and pasted into a dialog control, it will be surrounded by quotes. This function will remove the surrounding quotes, if present.

The quote character is specifically code 0x22 or 34. Escape characters are not allowed, therefore a quote is not allowed in the string (a quote is not allowed in a filename).

The resulting string cannot be larger than 512 characters.

Leading spaces are always trimmed prior to detecting the quote. When in command line mode, parse parameter set to TRUE, and a quote is not present, the data is copied until a space (0x20) is encountered.

Related Functions

Platform Support

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

Legato IDE, Legato Basic