How to customize formatting

I’ve noticed that TOAD has a formatter feature. This would really be a BIG productivity booster for me… if I could figure out how to set it up correctly.

I was able to set up most of the rules to do what I want, but I’m stuck at how to handle the spacing. I want to use spaces, not tabs for spacing. However, the spacing naturally depends on what statement it is.

E.g. the word ‘if’ is two characters long, so I want the statements in the if block to have 3 spaces, like:

if condition_is_true then
do_something();
end if;

On the other hand, the word ‘when’ has four characters, so I want the statements under it to have 5 spaces:

when others then
do something();
end;

The same goes for ‘select’, ‘where’, ‘from’, etc.

How do I specify a spacing rule for each type of statement/clause?

Message was edited by: HappyCoder

Message from: HappyCoder

Oops. Apologies for posting in the wrong forum. Admins, could you please delete
this thread?


Historical Messages

Author: Happy Coder
Date: Tue Jul 26 00:10:58 PDT 2011

Oops. Apologies for posting in the wrong forum. Admins, could you please delete
this thread?

__

Author: Happy Coder
Date: Mon Jul 25 23:26:10 PDT 2011

I’ve noticed that TOAD has a formatter feature. This would really be a BIG
productivity booster for me… if I could figure out how to set it up correctly.

I was able to set up most of the rules to do what I want, but I’m stuck at
how to handle the spacing. I want to use spaces, not tabs for spacing. However,
the spacing naturally depends on what statement it is.

E.g. the word ‘if’ is two characters long, so I want the statements in
the if block to have 3 spaces, like:

if condition_is_true then
do_something();
end if;

On the other hand, the word ‘when’ has four characters, so I want the
statements under it to have 5 spaces:

when others then
do something();
end;

The same goes for ‘select’, ‘where’, ‘from’, etc.

How do I specify a spacing rule for each type of statement/clause?

Message was edited by: HappyCoder
__


Oops. Apologies for posting in the wrong forum. Admins, could you please delete this thread?