Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Delphi 10 Formatter..


This question is answered.


Permlink Replies: 2 - Last Post: Nov 14, 2015 7:22 PM Last Post By: Ian Branch
Ian Branch

Posts: 442
Registered: 9/23/99
Delphi 10 Formatter..  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 14, 2015 10:35 AM
Hi Team,
I have a piece of code..
if (sChar = '0') or (sChar = 'P') then nChar := nChar + 0;

Which I would like to keep looking like that.

But when I run the formatter it does this..
if (sChar = '0') or (sChar = 'P') then
nChar := nChar + 0;

I can't see any mechanism in the Formatter options that would turn this action off.

Have I missed something or does it simply not allow it?

Regards & TIA,
Ian
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: Delphi 10 Formatter..
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 14, 2015 2:14 PM   in response to: Ian Branch in response to: Ian Branch
Ian Branch wrote:

Hi Team,
I have a piece of code..
if (sChar = '0') or (sChar = 'P') then nChar := nChar + 0;

Which I would like to keep looking like that.

But when I run the formatter it does this..
if (sChar = '0') or (sChar = 'P') then
nChar := nChar + 0;

I can't see any mechanism in the Formatter options that would turn this action off.

Have I missed something or does it simply not allow it?

Regards & TIA,
Ian

Ian,
In Tools - Options - Formatter - Delphi - Line breaks
Look for 'Line breaks before single instructions in control statements'

--
Tom Brunberg
firstname.lastname@welho.com

Ian Branch

Posts: 442
Registered: 9/23/99
Re: Delphi 10 Formatter..  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 14, 2015 7:22 PM   in response to: Tom Brunberg in response to: Tom Brunberg
Excellent!

Thanks Tom.

Regards,
Ian
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02