GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Two — Language Overview (continued)
Overview
The ConsoleGetHandle function retrieves the handle associated with a specific console window.
Syntax/Parameters
Syntax
handle = ConsoleGetHandle ( [int id] );
Parameters
id
An optional int specifying a console ID from 0 to 7. If omitted, the default console window ID of 0 is returned.
Return Value
Returns a handle value or NULL_HANDLE on error. Use the GetLastError function to retrieve a formatted error code.
Remarks
The handle value returned is a window handle when operating as a Windows application or a pseudo handle for the command line console window. The pseudo handle is not the handle to the actual shell that executed the script but rather an internal semaphore for standard input and output.
Example
In the following example, the console handle is retrieved to use the AddMessage function to write to the console.
string list[]; int ix; handle hCon; AddMessage("This is the default log"); ConsoleOpen(); hCon = ConsoleGetHandle(); AddMessage(hCon, "File dump to console:"); list = EnumerateFiles(GetScriptFolder() + "*.*"); while (list[ix] != "") { AddMessage(hCon, " %2d : %s", ix, list[ix]); ix++; } AddMessage("This is the END of the default log");
In this example, the ConsoleOpen function is inert when running as a console application; however, it is needed when running in the IDE since, unlike the ConsolePrint function, the AddMessage function will not automatically open a console in the IDE. As a console application, the messages (file list) are dumped to the console and then the default log. Under the IDE, the default log appears in the Information View and a console window will contain the files.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.