Curious:

The most simple OPEN is OPEN FILE TO F.FILE ELSE STOP.
The second most simple is OPEN FILE TO F.FILE ELSE STOP 201, FILE

Where neither pauses to inform but the second one uses the ERRMSG handler.

Does the M in STOPM mean pause for a message.

There is also some caution with simply stopping a program due to a
non-opening file. If you're running several sequential programs in a PROC
and one of them has the STOP based on a non-opening file, the next program
may not know this and may process regardless.

In my OPENER, I do a CHAIN "M" (or whatever local starting point is) when
the file doesn't open. Do not pass GO, do not collect $200.

My 1 cent.
Mark Johnson


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, March 25, 2007 10:57 AM
Subject: Re: [U2] New to UV/PICK, programming a banner


> Precisely why I use uniVerse's stopm directive:
>
> open '','FILE' to FILE else stopm 'No FILE File!'
>
> It's a simple oneliner that tells you all you need to know upon failure.
>
> Karl
>
> <quote who="MAJ Programming">
> > Observation on coding technique:
> >
> > If you have 20 or more files that need to be opened, do you use the same
> > construct OPEN THEN or is this just an example for this reply.
> >
> > I've observed this technique in one client that I've acquired and it
seems
> > inappropriate to have the entire program indented so many times based on
> > the
> > number of OPENS. Plus, to have the CANT OPEN messages sorta mirrored
> > hundreds if not thousands of lines after their respective OPEN requests
> > makes for hard to manage code.
> >
> > IF you use any formatting programs then having the mainline code
indented
> > to
> > position 60 or 80 is just stupid.
> >
> > A note to the newbies on this forum. Please do not use this method for
> > OPENing files. 99.99% of the time an OPEN is a pass/fail method for the
> > rest
> > of the program to continue. If any file doesn't open, then game over and
> > do
> > not process anything in the file.
> >
> > You can use my OPENER sub that's been published and posted before, or
you
> > can use any localized OPEN ELSE CANT OPEN logic contained in a few lines
> > by
> > itself. But to have the OPENS and CANT OPEN messages so far apart is ill
> > advised.
> >
> > My 2 cents
> > Mark Johnson
> >
> > ----- Original Message -----
> > From: "Louis Windsor" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Sunday, March 25, 2007 1:20 AM
> > Subject: Re: [U2] New to UV/PICK, programming a banner
> >
> >
> >> Simply:-
> >>
> >> ED BP MOTD
> >> I <Enter>
> >> OPEN 'file' TO file THEN
> >>          READ MOTD FROM file,'MOTD' THEN
> >>                      CNT=DCOUNT(MOTD,@FM)
> >>                      FOR X=1 TO CNT; CRT MOTD<X>; EXT X
> >>                      CRT; CRT 'Read and Press Enter To Continue'; INPUT
> >> WHATEVER:
> >>                      STOP
> >>           END ELSE
> >>                      CRT; CRT 'No Message Of The Day'; CRT; STOP
> >>           END
> >> END ELSE
> >>           CRT; CRT 'No MOTD File'; CRT; STOP
> >> END
> >> <Enter>
> >> FI
> >>
> >> "file" is whatever file you wish to use even &TEMP& or CTL (general
> > control
> >> file)?
> >>
> >> Compile and include line
> >>
> >> RUN BP MOTD
> >>
> >> in your LOGIN paragraph
> >>
> >> To create the message:-
> >>
> >> ED file MOTD  (or wED or whatever editor)
> >> I
> >> Type whatever message you want to display here
> >> <Enter>
> >> FI
> >>
> >> To delete the message
> >>
> >> ED file MOTD
> >> FD
> >>
> >> Like I said it is simple.  Assumes the message is less than a screen
> >> full
> >> and each line is less than screen width.
> >>
> >> No flames please - I said it is simple.
> >>
> >> Louis
> >>
> >> ----- Original Message -----
> >> From: "Gabriel Green" <[EMAIL PROTECTED]>
> >> To: <[email protected]>
> >> Sent: Sunday, March 25, 2007 12:38 PM
> >> Subject: [U2] New to UV/PICK, programming a banner
> >>
> >>
> >> > Hello,
> >> >
> >> > I am new to PICK/UniVerse and was wondering if someone could help me
> > with
> >> > some BASIC code or a PROC instructions to get me going on a banner
> > program
> >> > that will display before, or after, the "Logon Please:" prompt (but
> > after
> >> > the initial telnet server login).
> >> >
> >> > Preferrably I'd like a unix style /etc/motd type thing (we're on
> >> Windows
> >> > of
> >> > course so that is not available, UV 10.2.) that I could update
> >> > periodically
> >> > with wED and update for our users to see.
> >> >
> >> > Can anyone help with this?
> >> >
> >> > Thanks,
> >> > Gabe
> >> > -------
> >> > 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/
> >
>
>
> --
> Karl Pearson
> Director of I.T.
> ATS Industrial Supply, Inc.
> [EMAIL PROTECTED]
> http://www.atsindustrial.com
> 800-789-9300 x29
> Local: 801-978-4429
> Fax: 801-972-3888
>
> "To mess up your Linux PC, you have to really work at it;
>  to mess up a microsoft PC you just have to work on it."
> -------
> 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