Sign in Join
Wiki copytemporary

Messages

Deutsch · English

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:

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

The syntax for notes looks like this:

pascal
  {$Note Message text}

The syntax for warnings looks like this:

pascal
 
  {$Warning Warning Message text}

The syntax for hints looks like this:

pascal
 
  {$Hint Warning Message text}

The syntax for error messages looks like this:

pascal
 
  {$Error Error Message text}

The syntax for fatal error messages looks like this:

pascal
  {$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.


From the Free Pascal wiki, page "Messages", as it stood on 2020-02-20 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.