I've inherited a few apps whereby the data grew beyond any original ideas.
Thus I *always* create my LAST variable outside of the loop. It gets
exponential.

I'm not worried about the extra variables in this sense. I have inherited
such an incredible collection of crap over the years it's mind boggling.
Having a consistent LAST=DCOUNT prior to a loop also lets me know what the
last element is. I'm starting to use Accuterm GUI and its Gauge component
wants to know the end.

Perhaps not for everyone on this list as there are some pretty sharp people
here, but sometimes I feel that I can improve almost any program I come
across. It truly is an untamed world of compiled working source code out
there (legacy) that at the very least, got us to where we are today.

One simple question.

Was it ever *required* to have the double quotes representing the unused
DICT clause in an OPEN statement. I remember in 1978 being taught
OPEN "","CUSTOMER" TO F.CUSTOMER ELSE STOP 201,"CUSTOMER"
and once accidentally forgetting the ("",) and it didn't matter. To this day
I've not run into a situation where it matters.

Thanks in advance.

----- Original Message -----
From: "Serguei Poliakov" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 29, 2005 5:27 AM
Subject: Re: [U2] Good Programming Practice Question.........


> Why do you need to create an extra variable (LAST)? It only make sense if
> the number of elements in ARRAY is really big. If you expect it to have 1
to
> 10 elements an extra variable only makes your code more difficult to
> maintain.
>
> On REMOVE I completely agree with you - it just makes it more difficult to
> understand the code without giving anything in return.
>
> ----- Original Message -----
> From: "Mark Johnson" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Tuesday, September 27, 2005 10:46 PM
> Subject: Re: [U2] Good Programming Practice Question.........
>
>
> > Another good suggestion:
> > Use:
> > LAST=DCOUNT(ARRAY,CHAR(253))
> > FOR I=1 TO LAST
> > blah
> > NEXT I
> > instead of
> > FOR I=1 TO DCOUNT(ARRAY,CHAR(253))
> >
> > I know that REMOVE is pretty promoted here but most times I use a
FOR/NEXT
> > loop because I don't want to maintain a separate mv variable for using
any
> > other associated attributes.
> >
> > My 1 cent.
> >
> > ----- Original Message -----
> > From: "Keith W. Roberts" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Tuesday, September 27, 2005 5:14 PM
> > Subject: RE: [U2] Good Programming Practice Question.........
> >
> >
> > > I most heartily agree!  Numbers in the labels don't elucidate; they
> merely
> > > increase the length.  And I'm pretty sure I know that "U" comes
> somewhere
> > > after "S". :)
> > >
> > > My $0.02 (on issues ancillary to the code itself) ...
> > >
> > > - make your BP files Type19 (DIR), so you can edit them outside of U2
> > using
> > > whatever cotton-pickin' editor you like
> > >
> > > - use source code control; absolutely anything is better than nothing,
> and
> > > there are good free ones for all platforms
> > >
> > > - agree on an indentation scheme and stick to it as a group, else
> > get/create
> > > a beautifier which enforces the chosen standards before code checkin
> > >
> > > -Keith
> > >
> > > ----Original Message----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On Behalf Of Bill_H
> > > Sent: Tuesday, September 27, 2005 1:35 PM
> > > To: [email protected]
> > > Subject: RE: [U2] Good Programming Practice Question.........
> > >
> > > > Kevin:
> > > >
> > > > Not if you alphabetize the labels; then it works just like numeric.
> > > > :-)
> > > >
> > > > Bill
> > > >
> > > >> -----Original Message-----
> > > >> From: [EMAIL PROTECTED]
> > > >> [mailto:[EMAIL PROTECTED] On Behalf Of Kevin King
> > > >> Sent: Tuesday, September 27, 2005 1:04 PM
> > > >> To: [email protected]
> > > >> Subject: RE: [U2] Good Programming Practice Question.........
> > > >>
> > > >> And here's where the conflict begins.  When looking through a
> > > >> big program, I much prefer numeric labels in order with comments
vs.
> > > >> alphanumeric labels.  With numeric labels in order you find
> > > >> 1800 and if you're looking for 2000 you know to look farther
> > > >> down, 1000, go up.
> > > >> With alpha labels if you find SELECT.FILE and are looking for
> > > >> UPDATE.FILES, you have nothing but experience to know whether
> > > >> to look up or down from there.
> > > >>
> > > >> Numeric labels are good.  Not ordering or commenting them is
> > > >> bad.  And not putting comments around all labels to make them
> > > >> more easily distinguished from the rest of the program is
> > > >> near unforgiveable.
> > > >>
> > > >> -K
> > > >>
> > > >> -----Original Message-----
> > > >> From: [EMAIL PROTECTED]
> > > >> [mailto:[EMAIL PROTECTED] On Behalf Of Allen E.
> > > >> Elwood Sent: Tuesday, September 27, 2005 12:40 PM
> > > >> To: [email protected]
> > > >> Subject: RE: [U2] Good Programming Practice Question.........
> > > >>
> > > >> My addition to this would be to use alphanumeric labels, and
> > > >> to *have* a main calling section.  A main calling section
> > > >> that looks like:
> > > >>
> > > >> GOSUB OPEN.AND.INIT
> > > >> GOSUB SELECT.FILE
> > > >> GOSUB PRE-PROCESS.VALIDITY.CHECKS
> > > >> GOSUB PRINT.INVOICES
> > > >> GOSUB UPDATE.FILES
> > > >>
> > > >> Looks so much better and is so easier to figure out than
> > > >>
> > > >> GOSUB 100
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >> GOSUB 1250
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >> GOSUB 1375
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >> GOSUB 4000
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >> GOSUB 9755
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >> a bunch of statements
> > > >>
> > > >> IMNSHO - *=aee=*
> > > -------
> > > u2-users mailing list
> > > [email protected]
> > > To unsubscribe please visit http://listserver.u2ug.org/
> > -------
> > u2-users mailing list
> > [email protected]
> > To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to