Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter TwoLanguage Overview (continued)

ScriptGetComments Function

Overview

The ScriptGetComments function scans a specified script file and returns a string containing any discovered pragma comments. Pragma comments are separate and distinct from program comments.

Syntax/Parameters

Syntax

string = ScriptGetComments ( [string source] );

Parameters

source

An optional string containing a qualified filename of the script to examine. If not provided, the currently executing script is used as the source.

Return Value

Returns a string containing the comments or empty on failure. If the script does not contain any pragma comments, an empty string will also be returned. Use the GetLastError function to retrieve a formatted error code. The IsError and IsNotError functions can be used to determine if an error occurred.

Remarks

Unlike program comments, pragma survive crunching and can then be used to convey information.

Pragma comments are created using the pragma C directive. For example:

#pragma C Title:       Open File with Data View

#pragma C Level:       0

#pragma C Description: Tests direct open view.

#pragma C Functions:   DataViewOpenFile

The string returned will be:

Title:       Open File with Data View

Level:       0

Description: Tests direct open view.

Functions:   DataViewOpenFile

While the content is user defined, certain structures are used for script security and identification.

The comments are added to the string on a line-by-line basis and separated with a 0x0D line-ending character. The last comment entry will be terminated with a line ending.

Related Functions

Platform Support

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

Legato IDE, Legato Basic