I never indicated that one should not have the "Can't Open" message. I just
laugh at the prior programmer's methods.

My OPENER subroutine is as follows:

SUBROUTINE OPENER(FILENAME, FILEHANDLE)
OPEN FILENAME TO FILEHANDLE ELSE
     PRINT "CANNOT OPEN ":FILENAME:". PRESS <ENTER> ":;INPUT ANS
     CHAIN "M"
END
RETURN

I also have a blind version that I've used for a Redback Project.

SUBROUTINE RB.OPENER(FILENAME, FILEHANDLE, ERRMSG)
OPEN FILENAME TO FILEHANDLE ELSE
     ERRMSG<-1>= "CANNOT OPEN ":FILENAME
END
RETURN

One thing that I will stand by is to not be afraid of posting my code
samples and wait for the flames to come. Don't attack my CHAIN "M" because
another app may have another bail out for the failed OPEN. Just appreciate
the simplicity of having thousands of OPEN statements use the same singular
"Can't Open" routine.

It does take someone with some cajones to show their cards for everyone else
to critique. I'm the first person to be interested in a better way of coding
as it makes my life easier.

In fact, one of my Mvbase client's systems was written by a programmer who
clearly didn't know enough functions. It's a terrible mess of disconnected
thoughts but, at the end of the day, it compiles and one plus one equals
two.

While I critique that code, I did manage to find a nice snippet that I've
added to my mental library of snippets. Yes, one can teach an old dog new
tricks.

The issue is that many programmers don't want to learn another (perhaps
better) method for the same objective. Thus poor techniques are perpetuated
and the newbies see the old guys doing them so they buy into it.

Unless there becomes an overall MV standard (never happen), MV programming
will continue to be the blank sheet of paper with a box of crayons that, if
it compiles, it's a program. I'm not condoning or promoting poor habits. I'm
just throwing up my 2 cents on what I think is poor and what I think is
good. If someone wants to type the tired EOF=FALSE;LOOP;READNEXT ID
ELSE;EOF=TRUE;END;UNTIL EOF DO mess for the rest of their lives as that's
what they learned first (and once), then that's their decision. I just don't
think that it should be endorsed as THE 'standard' method as our MV
environment is incredibly absent of standards. Styles, yes. Local standards,
sure, Overall standards, hardly.

Respectfully
Mark Johnson
----- Original Message -----
From: "Symeon Breen" <[EMAIL PROTECTED]>
To: <u2-users@listserver.u2ug.org>
Sent: Wednesday, March 14, 2007 4:10 AM
Subject: Re: [U2] Error in report generation.


> On 14/03/07, MAJ Programming <[EMAIL PROTECTED]> wrote:
> >
> > I'm gonna throw my 4 cents in to hopefully stop this excessive coding.
> >
> >
> >
> > or this doozy of a mess
> > OPEN "FILE1" TO F.FILE1 THEN
> >      OPEN "FILE2" TO F.FILE2 THEN
> >           OPEN "FILE3" TO F.FILE3 THEN
> >                <500 LINES OF PROCESSING AS PER APPLICATION>
> >           END ELSE
> >                 PRINT "CAN'T OPEN FILE3"
> >          END
> >      END ELSE
> >          PRINT "CAN'T OPEN FILE2"
> >      END
> > END ELSE
> >      PRINT "CAN'T OPEN FILE1"
> > END
> >
> > Please, lets not spend so much effort on this simple task. OPEN them and
> > get
> > on with it.
> >
> > However the above is essential if you have to return a message to a
> controlling program or web service say and not just stop execution !!
> Thats why i prefer a function for file operations rather than a sub then
you
> can do
> IF fileOpenFunc("filename",options,filevar,etc) THEN
>  <blah>
> END ELSE
>  Err = blah
> END
> -------
> 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