Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Minimising deep indentation
On 2005-05-20, dn.perl_at_gmail.com <dn.perl_at_gmail.com> wrote:
>
> I have taken over some PL/SQL code which is deeply indented.
> Some lines have 10-12 tabs before code appears on them. I want
> to minimise this. I don't even mind introducing an
> "indent_help_exception" for this purpsoe.
>
> If my entire code is trapped within if not(date_cycle is null),
> then I want to trap if(date_cycle is null) case first.
>
> current code :
> if (condition1) then
> register a small 'error' message ;
> else
> a block of 300 lines; -- which later has deep indents needing
> 10-12 tabs
> end if ;
>
>
> Desired format :
> if (condition1) then
> do something to quit/jump/goto/return
> maybe raise indent_related_exception and quit
> end if ;
> a block of 300 lines; -- here one tab for indentation is saved
> compared to above code...
I'd probably created a procedure that contains these 300 lines:
if (condition1) then
register a small 'error' message;
else
those_300_lines(param_1, param_2...);
end if ;
procedure those_300_lines(param_1 in varchar2...) is begin a block of 300 lines; -- here one tab for indentation is saved end those_300_lines;
hth
Rene
-- Rene Nyffenegger http://www.adp-gmbh.ch/Received on Sat May 21 2005 - 02:13:51 CDT
![]() |
![]() |