System.IsConsole

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

IsConsole: Boolean;       { True if compiled as console app }

C++

extern DELPHI_PACKAGE bool IsConsole;

Properties

Type Visibility Source Unit Parent
variable public
System.pas
System.hpp
System System

Description

Indicates whether the excecutable module was compiled as a console application.

For Windows platforms, the IsConsole variable is True if the module was linked as a console application. To specify the console application, Compiler's -CC option or {$APPTYPE CONSOLE} should be used. Otherwise, the application is in GUI mode.

If the IsConsole variable is False, the application can't use console input and output. WriteLn / ReadLn may raise the exception if the application manually opens the console.

For other platforms, the IsConsole variable is True, even if the application is in GUI mode. The application can read or write to console.

See Also