Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter TwoLanguage Overview (continued)

ConsolePrint Function

Overview

The ConsolePrint function prints data directly to the specified or default console window.

Syntax/Parameters

Syntax

int = ConsolePrint ( [handle hConsole], string format, [mixed parameters ... ] );

Parameters

hConsole

An optional handle to a console window. If omitted, the function will operate on the default console.

format

A string containing a template that specifies the structure of the resulting string. See Section Section 5.2 String Functions for information on creating formatted strings.

parameters

Zero or more parameters to be formatted and inserted into format. If no parameters are supplied, the template is simply passed through to the result string.

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure.

Remarks

When printing to the default console, the console window will automatically be opened if it is not already open.

Formatted strings allow numeric and other data to be formatted into a string for appropriate display. The format of the string and the data to be inserted depend upon the structure of the format parameter and the contents of the additional parameters passed to the function. For more information on formatted strings, see Section 5.1.3. The maximum size of the formatted buffer is 4,096 bytes. Exceeding this value will result is the string being truncated with an error and a warning placed into the script error log.

Line endings are processed as \r (0x0D) for a line return, which sets the X position to zero but does not advance to the next line, or the newline character \n (0x0A), which advances to the next line and resets the X position to zero. Note that when printing to the console, it is advisable to use the \n character only since any data “piped” to a file or other process will force the \n character to be automatically translated to \r\n. Thus. if the conventional \r\n is employed, the output to a pipe will turn into \r\r\n.

[‡this should probably do something to compensate for such stupidity]

Related Functions

Platform Support

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

Legato IDE, Legato Basic