Difference between revisions of "Messages"

From Free Pascal wiki
Jump to navigationJump to search
(English translation of German page)
 
(No difference)

Latest revision as of 00:55, 21 February 2020

Deutsch (de) English (en)

Free Pascal allows the programmer to define normal messages, warning and error messages. These messages are displayed in the message window.

These self-defined messages are intended to enable the programmer to better oversee and manage his code.

The compiler treats these messages as if they were messages generated by the compiler. This means that if the compiler has been instructed not to issue warnings, then self-defined warnings will not be issued.

In contrast, error messages are always displayed. The compiler stops when there are 50 error messages. If an error message occurs, no executable file is created. In the event of a fatal error, the compiler stops immediately.

The syntax for messages looks like this:

 
  {$Message Message text}
  // or
  {$Info Message text}

The syntax for notes looks like this:

  {$Note Message text}

The syntax for warnings looks like this:

 
  {$Warning Warning Message text}

The syntax for hints looks like this:

 
  {$Hint Warning Message text}

The syntax for error messages looks like this:

 
  {$Error Error Message text}

The syntax for fatal error messages looks like this:

  {$Fatal Error Message text}
  // or
  {$Stop Error Message text}

Note: You cannot use } in a message because this is the terminating character of a message for the compiler.