Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter TwoLanguage Overview (continued)

ConsoleGetLine Function

Overview

The ConsoleGetLine function attempts to retrieve a string of data from the default or specified console as terminated by a return or break.

Syntax/Parameters

Syntax

string = ConsoleGetLine ( [string escape] );

Parameters

escape

An optional string specifying characters that will stop the processing. the default is “\r”.

Return Value

A string containing the returned data keyed into the console or empty on failure. Use the GetLastError function to retrieve a formatted error code. If Escape or Ctrl+C is pressed, the error will be returned as ERROR_CANCEL with the code in the return string.

Remarks

This function only operates on the console version of Legato Basic on the default console window. For other versions, ERROR_FUNCTION_NOT_SUPPORTED will be returned.

Input is retrieved from stdin or the standard input which by default is the keyboard.

Characters are collected and echoed to the console. The control character 0x08, Backspace, is processed backing up in the buffer and erasing the previous character in the console window. If an escape string is not provided, keyboard input is collected until a return, Enter, or escape/break is detected.

Escape and break set 0x1B or 0x03 in the first character of the return string. The return character is not added to the return string. Any other specified characters are added as the last character of the string.

The Enter key will also reposition the console to the start of the next line on the screen.

The maximum size of the return buffer is 1MB. In an overflow condition, characters are simply not added to the buffer.

Related Functions

Platform Support

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

Legato IDE, Legato Basic