Call me old-school but I prefer top-down OPEN file TO handle ELSE STOP (sic)
to get them all out of the way. Whether 1 or 50 files, the get all opened at
the same time. If those choose to have a CALL OPEN.FILES internal sub or
named commons, then that's also a respectable method.

To have the main portion of the code be that indented only makes maintenance
later that much more difficult. Very, very few people seem to label their
END statements to indicate what they're matched to.

Upon further investigation (using that programmers initials) i found that
when there were 8 or more file, he did it in a more top-down or sequential
fashion. That introduces 2 forms of coding for the same concept which is 1
form too many.

That programmer is still at this client and uses the tired response "That's
what I was taught" when shown how hard it is to follow all of those indents.
Can't teach an old dog...

my 1 cent
----- Original Message -----
From: "Jerry Banker" <[EMAIL PROTECTED]>
To: <u2-users@listserver.u2ug.org>
Sent: Friday, April 15, 2005 10:36 AM
Subject: Re: [U2] Multiple OPEN statements


> ----- Original Message -----
> > From: "Don Kibbey" <[EMAIL PROTECTED]>
> > You did mention only a few files display this type of syntax.  Perhaps
> > said programmer was shown the door....
>
> I don't see why you would think that and frankly I'm surprised you haven't
> come across this style of programming before. This style of programming
was
> taught in classrooms all over the country before the advent of point and
> click programming. It is a structured way of programming based on a logic
> sequence:
> What is the first file I need?
> OPEN FILE1 TO F.FILE1 THEN
> END ELSE PRINT "CAN'T OPEN FILE1"
> END
>
> Do I need another one?
> OPEN FILE1 TO F.FILE1 THEN
>      OPEN FILE2 TO F.FILE2 THEN
>      END ELSE PRINT "CAN'T OPEN FILE2"
> END ELSE PRINT "CAN'T OPEN FILE1"
> END
>
> And another?
> OPEN FILE1 TO F.FILE1 THEN
>      OPEN FILE2 TO F.FILE2 THEN
>          OPEN FILE3 TO F.FILE3 THEN
>          END ELSE PRINT "CAN'T OPEN FILE3"
>      END ELSE PRINT "CAN'T OPEN FILE2"
> END ELSE PRINT "CAN'T OPEN FILE1"
> END
>
> Now that I've got these open what do I do with them>
> OPEN FILE1 TO F.FILE1 THEN
>      OPEN FILE2 TO F.FILE2 THEN
>          OPEN FILE3 TO F.FILE3 THEN
>              EOF=0
>              LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
>              PROCESS, PROCESS, PROCESS
>              REPEAT
>          END ELSE PRINT "CAN'T OPEN FILE3"
>      END ELSE PRINT "CAN'T OPEN FILE2"
> END ELSE PRINT "CAN'T OPEN FILE1"
> END
>
> Although when the gosub came out most programmers took the center out and
> put it into a separate subroutine.
> -------
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to