OpenConsole()

Syntax

Result = OpenConsole()
Description
Open a console window. This function must be called before any other function of this library. Only one console can be opened at the same time in a PureBasic program. If Result is 0, it has failed and all further call to console commands must be disabled. The console can be closed using the CloseConsole() command.

On Microsoft Windows, there is two differents executable formats: Win32 and Console. If you want to create a standard console application, like 'dir', 'del' etc.. you must compile the executable using the 'Console' format (Compiler Option menu in the PureBasic IDE).

Parameters:
This command has no parameters.


Return value:
The value returned by this command can be used to determine whether the console window was opened successfully or not. If the window could not be opened the result will be zero. If the window was opened successfully then the result will be non-zero.


Example:
  OpenConsole()
  Delay(2000)
  End

Supported OS

Windows, Linux, MacOS X

<- Input() - Console Index - Print() ->