Recent

Author Topic: $FATAL directive message text  (Read 703 times)

440bx

  • Hero Member
  • *****
  • Posts: 1888
$FATAL directive message text
« on: February 08, 2020, 05:17:23 am »
Hello,

Is it possible to break the message text that follows a {$FATAL } directive onto multiple lines or does the message text have to be all on the same line as the $FATAL directive ?  IOW, I'd like to have something along the lines of
Code: Pascal  [Select][+][-]
  1. {$FATAL the message text is
  2. on more than one line}
The above was my attempt but, the compiler only output what's on the first line, I'd like the entire text displayed.

Thank you for your help.
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 10193
Re: $FATAL directive message text
« Reply #1 on: February 08, 2020, 08:18:03 am »
It will display the whole message, but does not support linebreaks, so the whole message is on one line.
Code: Bash  [Select][+][-]
  1. Fatal: User defined: the message text ison more than one line
I am more like donkey than shrek

PascalDragon

  • Hero Member
  • *****
  • Posts: 1720
  • Compiler Developer
Re: $FATAL directive message text
« Reply #2 on: February 08, 2020, 10:05:58 am »
As Thaddy wrote it works. You need to put a space at the start of the next line though as otherwise you'll get the lines concatenated to each other.

Code: Pascal  [Select][+][-]
  1. {$FATAL This is a message that
  2.  is on multiple lines }

Code: [Select]
Fatal: User defined: This is a message that is on multiple lines
If it still does not work please provide compiler version, platform and a full example.

440bx

  • Hero Member
  • *****
  • Posts: 1888
Re: $FATAL directive message text
« Reply #3 on: February 08, 2020, 10:38:41 am »
As Thaddy wrote it works.
Yes, you are both right.

Due to indentation, I had about 20 leading spaces to visually align the second line's text to the beginning of the first line.  Those leading spaces caused the second line not to be visible in Lazarus messages' window (too far off to the right) which left me with the mistaken impression that the compiler had ignored the second line.

Thank you both for your help.

FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

 

TinyPortal © 2005-2018