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 functions must be disabled. The console can be closed using the CloseConsole() function.

With EnableGraphicalConsole() the console can be switched between text and graphics mode.

On Microsoft Windows, there are two different 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). On Linux and OS X, this command has no effect, as there is no special 'Console' format.

Example:
  OpenConsole()
  PrintN("Waiting 5 secs before quit...")
  Delay(5000)

Supported OS

All

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