Also better for debugging...I think. you can break on the then clause or else 
clause rather than the IF

> -----Original Message-----
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of Mecki Foerthmann
> Sent: Sunday, 22 April 2012 8:50 a.m.
> To: u2-users@listserver.u2ug.org
> Subject: Re: [U2] Case Statement with only two cases... or for that matter...
> one case
> 
> Well,
> 
> I prefer:
> 
> IF A = "TEST" THEN
>     GOSUB DO.SOMETHING                       ;* Say why
> END ELSE
>     GOSUB DO.SOMETHING.ELSE              ;* The reason
> END
> 
> IMO much more readable - because you see immediately that is is a
> conditional branching.
> It is also easier maintainable if you want to add some more code later or
> you need more conditions and want to change branching into case.
> 
> And of course it will auto-indent correctly in my editor of choice ;-).
> 
> On 20/04/2012 23:05, Kate Stanton wrote:
> > Rather than:
> >
> > BEGIN CASE
> >    CASE A = "TEST"; GOSUB DO.SOMETHING
> >    CASE 1; GOSUB DO.SOMETHING.ELSE
> > END CASE
> >
> > or
> >
> > IF A = "TEST" THEN GOSUB DO.SOMETHING ELSE GOSUB
> DO.SOMETHING.ELSE
> >
> > I prefer:
> >
> > IF A = "TEST" THEN GOSUB DO.SOMETHING             ;* Say why
> > ELSE                          GOSUB DO.SOMETHING.ELSE  ;* The reason
> >
> > lining up the GOSUBs under each other, with comment making it clear
> why.
> _______________________________________________
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to