Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread Bill Brutzman
The case statement has a huge advantage in what really matters... human 
readability... that is the point.

>From readability follows... reliability, maintainability, and testability... 
>better, cleaner, safer software.

An irony is that while the "if" statement...  is the cornerstone of all 
computing... the "if" is also a problematic and mostly obsolete construct.

--Bill

-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
Sent: Thursday, April 19, 2012 3:52 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Case Statement with only two cases


Is there a point in code like this

BEGIN CASE
   CASE A = "TEST"; GOSUB DO.SOMETHING
   CASE 1; GOSUB DO.SOMETHING.ELSE
END CASE

versus this

IF A = "TEST" THEN GOSUB DO.SOMETHING ELSE GOSUB DO.SOMETHING.ELSE

Personally I see no advantage in making this a  CASE

Does the rest of the *Universe* agree with me?
___
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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread Wjhonson

Explain more what you mean by saying the if is problematic and obsolete ?




-Original Message-
From: Bill Brutzman 
To: U2 Users List 
Sent: Thu, Apr 19, 2012 1:35 pm
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case


The case statement has a huge advantage in what really matters... human 
eadability... that is the point.
>From readability follows... reliability, maintainability, and testability... 
etter, cleaner, safer software.
An irony is that while the "if" statement...  is the cornerstone of all 
omputing... the "if" is also a problematic and mostly obsolete construct.
--Bill
-Original Message-
rom: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] 
n Behalf Of Wjhonson
ent: Thursday, April 19, 2012 3:52 PM
o: u2-users@listserver.u2ug.org
ubject: [U2] Case Statement with only two cases

s there a point in code like this
BEGIN CASE
  CASE A = "TEST"; GOSUB DO.SOMETHING
  CASE 1; GOSUB DO.SOMETHING.ELSE
ND CASE
versus this
IF A = "TEST" THEN GOSUB DO.SOMETHING ELSE GOSUB DO.SOMETHING.ELSE
Personally I see no advantage in making this a  CASE
Does the rest of the *Universe* agree with me?
__
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users
__
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users

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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread Bill Brutzman
1.Problematic...  [a] I run into sloppy if statements often... it is sometimes 
difficult for me to infer what the programmer was trying to accomplish. 
 
I would like to see

If XX then
Gosub YY

End else
Gosub ZZ
End

I often see shortcuts and fragmented if statements.

Some languages require a semicolon to specify the end 
of a line.  Some languages use curly braces to specify the beginning and end of 
say a function

[b] This problem gets exacerbated with nested if statements.

2. Obsolete... I look forward to the day when programmers start to realize 
that... for the reasons cited... and others... that IF statements are bad 
programming practice perhaps one notch above the goto statement.

--Bill


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
Sent: Thursday, April 19, 2012 4:57 PM
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case


Explain more what you mean by saying the if is problematic and obsolete ?



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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread Wjhonson
Give an example of, with what you would replace the If Then Else



-Original Message-
From: Bill Brutzman 
To: U2 Users List 
Sent: Thu, Apr 19, 2012 2:26 pm
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case


1.Problematic...  [a] I run into sloppy if statements often... it is sometimes 
ifficult for me to infer what the programmer was trying to accomplish. 

I would like to see
If XX then
   Gosub YY 

End else
   Gosub ZZ
End
I often see shortcuts and fragmented if statements.
Some languages require a semicolon to specify the end 
of a line.  Some 
anguages use curly braces to specify the beginning and end of say a function
[b] This problem gets exacerbated with nested if statements.
2. Obsolete... I look forward to the day when programmers start to realize 
hat... for the reasons cited... and others... that IF statements are bad 
rogramming practice perhaps one notch above the goto statement.
--Bill

Original Message-
rom: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] 
n Behalf Of Wjhonson
ent: Thursday, April 19, 2012 4:57 PM
ubject: Re: [U2] Case Statement with only two cases... or for that matter... 
ne case

xplain more what you mean by saying the if is problematic and obsolete ?

___
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users

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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread Bill Brutzman
The initial example was close to a good start... something like...

If XX then gosub YY  else  gosub ZZ

Replaced by

Begin case
   Case XX  ;  gosub YY
   Case 1 ;  gosub ZZ
End   case

Except that now... note that readability is enhanced by [1] indenting... so as 
to align text and [2] using mixed-case and camelCase typography.

--Bill
 
-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
Sent: Thursday, April 19, 2012 5:33 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case

Give an example of, with what you would replace the If Then Else


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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread George Gallen
That's like saying that Mercury's are being replaced by Ford's.same 
difference

-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Thursday, April 19, 2012 5:42 PM
To: U2 Users List
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case

The initial example was close to a good start... something like...

If XX then gosub YY  else  gosub ZZ

Replaced by

Begin case
   Case XX  ;  gosub YY
   Case 1 ;  gosub ZZ
End   case

Except that now... note that readability is enhanced by [1] indenting... so as 
to align text and [2] using mixed-case and camelCase typography.

--Bill
 
-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
Sent: Thursday, April 19, 2012 5:33 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case

Give an example of, with what you would replace the If Then Else


___
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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread Danny Ruckel
I don't agree that readability is improved when you use mixed case in your
"Case" (or "case") statement...


Danny



-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Thursday, April 19, 2012 2:42 PM
To: U2 Users List
Subject: Re: [U2] Case Statement with only two cases... or for that
matter... one case

The initial example was close to a good start... something like...

If XX then gosub YY  else  gosub ZZ

Replaced by

Begin case
   Case XX  ;  gosub YY
   Case 1 ;  gosub ZZ
End   case

Except that now... note that readability is enhanced by [1] indenting... so
as to align text and [2] using mixed-case and camelCase typography.

--Bill
 
-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
Sent: Thursday, April 19, 2012 5:33 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Case Statement with only two cases... or for that
matter... one case

Give an example of, with what you would replace the If Then Else


___
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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread dennis bartlett
Well, I wrote a proggie to process source code and break long IF/THEN/ELSE
into
IF   ... THEN
END ELSE
END

and also

SEL.VERB = 'SELECT FILE WITH J=1 AND K=2 AND L=3 BY ABC BY DEF BREAK-ON XYZ
TO

SEL.VERB = ''
SEL.VERB := "SELECT FILE"
SEL.VERB := " WITH J=1 AND"
SEL.VERB := " K=2 AND"
SEL.VERB := " L=3"
SEL.VERB := " BY ABC BY DEF"
SEL.VERB := " BREAK-ON XYZ"
SEL.VERB := etc

It does a few other personal likes

It's just a matter of choice - having been a maintenance contractor for
years I just like code that can easily be read within the 80 x 24 telnet
client

As for the mixed case thing, that has roared on forever, but it interesting
to note that many internal Universe progs are written in mixed case.
It all depends on the site, but mixed case requires dragonian standards
rules, which are too much of a bother...


On 20 April 2012 07:59, Danny Ruckel  wrote:

> I don't agree that readability is improved when you use mixed case in your
> "Case" (or "case") statement...
>
>
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread Wjhonson
I don't understand why you'd want this


<>





-Original Message-
From: dennis bartlett 
To: U2 Users List 
Sent: Thu, Apr 19, 2012 4:45 pm
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case


Well, I wrote a proggie to process source code and break long IF/THEN/ELSE
nto
F   ... THEN
ND ELSE
ND
and also
SEL.VERB = 'SELECT FILE WITH J=1 AND K=2 AND L=3 BY ABC BY DEF BREAK-ON XYZ
O
SEL.VERB = ''
EL.VERB := "SELECT FILE"
EL.VERB := " WITH J=1 AND"
EL.VERB := " K=2 AND"
EL.VERB := " L=3"
EL.VERB := " BY ABC BY DEF"
EL.VERB := " BREAK-ON XYZ"
EL.VERB := etc
It does a few other personal likes
It's just a matter of choice - having been a maintenance contractor for
ears I just like code that can easily be read within the 80 x 24 telnet
lient
As for the mixed case thing, that has roared on forever, but it interesting
o note that many internal Universe progs are written in mixed case.
t all depends on the site, but mixed case requires dragonian standards
ules, which are too much of a bother...

n 20 April 2012 07:59, Danny Ruckel  wrote:
> I don't agree that readability is improved when you use mixed case in your
 "Case" (or "case") statement...


__
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users

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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-19 Thread Wjhonson

You replace one line with four lines
I'm an atheist regarding the belief in code bloat



-Original Message-
From: Bill Brutzman 
To: U2 Users List 
Sent: Thu, Apr 19, 2012 4:48 pm
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case


The initial example was close to a good start... something like...
If XX then gosub YY  else  gosub ZZ
Replaced by
Begin case
  Case XX  ;  gosub YY
   Case 1 ;  gosub ZZ
End   case
Except that now... note that readability is enhanced by [1] indenting... so as 
o align text and [2] using mixed-case and camelCase typography.
--Bill

Original Message-
rom: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] 
n Behalf Of Wjhonson
ent: Thursday, April 19, 2012 5:33 PM
o: u2-users@listserver.u2ug.org
ubject: Re: [U2] Case Statement with only two cases... or for that matter... 
ne case
Give an example of, with what you would replace the If Then Else

__
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users

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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-20 Thread Symeon Breen
Both read exactly the same to me - the case probably takes a bit longer to
digest cos there is more text to read, but there is not much in it. - come
on guys if you have to think about any of these then perhaps you need to
change career ?





-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: 19 April 2012 22:42
To: U2 Users List
Subject: Re: [U2] Case Statement with only two cases... or for that
matter... one case

The initial example was close to a good start... something like...

If XX then gosub YY  else  gosub ZZ

Replaced by

Begin case
   Case XX  ;  gosub YY
   Case 1 ;  gosub ZZ
End   case

Except that now... note that readability is enhanced by [1] indenting... so
as to align text and [2] using mixed-case and camelCase typography.

--Bill
 
-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
Sent: Thursday, April 19, 2012 5:33 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Case Statement with only two cases... or for that
matter... one case

Give an example of, with what you would replace the If Then Else


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1424 / Virus Database: 2411/4946 - Release Date: 04/19/12

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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-20 Thread Wjhonson
You just want all the jobs to yourself :)



-Original Message-
From: Symeon Breen 
To: 'U2 Users List' 
Sent: Fri, Apr 20, 2012 1:45 am
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case


Both read exactly the same to me - the case probably takes a bit longer to
igest cos there is more text to read, but there is not much in it. - come
n guys if you have to think about any of these then perhaps you need to
hange career ?


-Original Message-
rom: u2-users-boun...@listserver.u2ug.org
mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
ent: 19 April 2012 22:42
o: U2 Users List
ubject: Re: [U2] Case Statement with only two cases... or for that
atter... one case
The initial example was close to a good start... something like...
If XX then gosub YY  else  gosub ZZ
Replaced by
Begin case
  Case XX  ;  gosub YY
   Case 1 ;  gosub ZZ
End   case
Except that now... note that readability is enhanced by [1] indenting... so
s to align text and [2] using mixed-case and camelCase typography.
--Bill

Original Message-
rom: u2-users-boun...@listserver.u2ug.org
mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
ent: Thursday, April 19, 2012 5:33 PM
o: u2-users@listserver.u2ug.org
ubject: Re: [U2] Case Statement with only two cases... or for that
atter... one case
Give an example of, with what you would replace the If Then Else

__
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users

o virus found in this message.
hecked by AVG - www.avg.com
ersion: 10.0.1424 / Virus Database: 2411/4946 - Release Date: 04/19/12
___
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users

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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-20 Thread Kate Stanton
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.
-- 
Kate Stanton
Walstan Systems Ltd
4 Kelmarna Ave, Herne Bay, Auckland 1011, New Zealand
Phone: + 64 9 360 5310  Mobile: + 64 21 400 486
Email: k...@walstan.com
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-21 Thread Mecki Foerthmann

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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-21 Thread dennis bartlett
@Mecki.. What is your editor of choice, ie can you get it to indent 1
space? I've always been a standard FORMAT in ED fella, but the site I've
just joined doesn't want that, code must start right up against the edge, &
have 2 space indenting.. So hard to not instinctively FORMAT, & equally
hard to find that missing 'END' when I can't simply format, since the code
structure looks so foreign & squashed up.

Thanks
Dennis
On Apr 22, 2012 6:50 AM, "Mecki Foerthmann"  wrote:

> 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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-21 Thread Larry Hiscock
Dennis,

You didn't mention if you're on UV or UD, but the FORMAT command in AE (in
UD) has options for margin and indent.  You can do FORMAT -M0 -I2 to get the
format you specified.

Larry Hiscock
Western Computer Services

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of dennis bartlett
Sent: Saturday, April 21, 2012 4:06 PM
To: U2 Users List
Subject: Re: [U2] Case Statement with only two cases... or for that
matter... one case

@Mecki.. What is your editor of choice, ie can you get it to indent 1 space?
I've always been a standard FORMAT in ED fella, but the site I've just
joined doesn't want that, code must start right up against the edge, & have
2 space indenting.. So hard to not instinctively FORMAT, & equally hard to
find that missing 'END' when I can't simply format, since the code structure
looks so foreign & squashed up.

Thanks
Dennis
On Apr 22, 2012 6:50 AM, "Mecki Foerthmann"  wrote:

> 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<http://listserv
> er.u2ug.org/mailman/listinfo/u2-users>
>
___
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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-22 Thread Phil Walker
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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-23 Thread Keith Johnson [DATACOM]
I prefer the layout of

IF A = "TEST"
   THEN GOSUB DO.SOMETHING  ;* Say why
   ELSE GOSUB DO.SOMETHING.ELSE ;* The reason

However, here is a form that's rarely used, but does work.

IF A = "TEST"
THEN ;* say why in a long-winded manner
   GOSUB DO.SOMETHING
END
ELSE ;* the reasoning behind the reason
   GOSUB DO.SOMETHING.ELSE
END

I don't use it myself, but it's very amenable to cut and paste programming.

Regards, Keith

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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-23 Thread Wjhonson

Why the extra lines?  Why not just
IF A = "TEST" THEN
   gosub do.something
END ELSE
   gosub do.something.else
END




<<>>





-Original Message-
From: Keith Johnson [DATACOM] 
To: 'u2-users@listserver.u2ug.org' 
Sent: Mon, Apr 23, 2012 5:44 pm
Subject: Re: [U2] Case Statement with only two cases... or for that matter... 
one case


I prefer the layout of
IF A = "TEST"
  THEN GOSUB DO.SOMETHING  ;* Say why
  ELSE GOSUB DO.SOMETHING.ELSE ;* The reason
However, here is a form that's rarely used, but does work.
IF A = "TEST"
   THEN ;* say why in a long-winded manner
  GOSUB DO.SOMETHING
   END
   ELSE ;* the reasoning behind the reason
  GOSUB DO.SOMETHING.ELSE
   END
I don't use it myself, but it's very amenable to cut and paste programming.
Regards, Keith
___
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users

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


Re: [U2] Case Statement with only two cases... or for that matter... one case

2012-04-25 Thread Keith Johnson [DATACOM]
Hi Will,

As I said, I don't use it myself, but a reason one might use
it is that one can easily cut and paste (or include) logic.

For example:
---
LOCKED
  put
  some
  generic
  logic
  here
END
---

regards, Keith


   WJohnson wrote:

   Why the extra lines?  Why not just
   IF A = "TEST" THEN
  gosub do.something
   END ELSE
  gosub do.something.else
   END

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