Confirm Exit From MAIN MENU

John Esak john at valar.com
Mon Jul 19 10:16:07 PDT 2010


I have a little better way to do this...


Since I know you're running Unix, Scott... I'll put the Unix version...
Windows users can fend... :-) 

It will also make use of some "highlighting" stuff that maybe only functions
on SCO... This stuff can go and the basic idea still works.


I create a file in the command PATH. I put it in /usr/local/bin... And call
it "stay".

It has this inside it:


trap "" 2 3
while :
do
p $fpm
clear
on=`tput smso`
off=`tput rmso`
export on off

menu="

                        Are you ${on} SURE ${off} you want to log out?

                     ${on} Y ${off} - Continue logging off completely.

                     ${on} N ${off} - (or any other key) to stay logged in!

                          Select> "


ans=`readone "$menu"`

case $ans in
        Y|y) clear;break
        ;;
        *)
        ;;
esac
done



Then in each filePro user's .profile I put their particular menu wrapped the
following way... Past the other stuff required in their .profile... So it is
the very last thing:


LPDEST=joanne
PFSPOOL="lp -s -djoanne"
MMPRINTERS="joanne"
export LPDEST PFSPOOL 

fpm=joanne
export fpm
exec stay



Now, when this user hits too many X'x, the stay program is executed and it
asks them "Are you sure you want to log all the way out?"  but much more
nicely formatted as you see above.  And if they hit any other key than Y the
program puts them back at their opening menu.  

I see that I"ve used Bob Stockler's miracle super-simple C program called
"readone".  This little executable also needs to be in a PATH folder.  It
acts on single keystrokes.  So the behavior is just like filePro's menu, it
doesn't force them to press X and then ENTER as they would have to do in any
shell script.

Give me a few minutes and I'll post that little sco-executable on my site in
this following link:


   http://www.valar.com/readone


This is one of the features most loved by my clients. It is so much hassle
to have to login again when you've pressed X too many times.  By the way, do
you see the little elegance built in that if they hit X one too many times,
and then once more... It brings them back to their opening menu... So that
the little prompt is almost not even seen. Why?  Because X is not a Y.  :-)
I like that last bit, it has levels and levels of fun in there... :-)

I believe there is a built in help for the readone program. As for Linux and
Windows users.  Bob once sent me the source. It's possible I could find it.
But this much of it, the Y or N part could be genned up quicker by just
writing it fresh and compiling it for your machine.  Although, Bob did put a
whole lot of niceties in his little program after a while.  For
exampole,with readone, you can accept only the letters r,q,m,n and z, and
not ENTER... And so forth. I am just making use of the simple Y or N
feature... Where ENTER equals an N.

Hope this helps.

John















> -----Original Message-----
> From: filepro-list-bounces+john=valar.com at lists.celestial.com 
> [mailto:filepro-list-bounces+john=valar.com at lists.celestial.co
m] On Behalf Of Bill Randall
> Sent: Monday, July 19, 2010 12:16 PM
> To: Scott Walker
> Cc: filepro-list at lists.celestial.com
> Subject: Re: Confirm Exit From MAIN MENU
> 
> On 7/19/2010 12:11 PM, Scott Walker wrote:
> >
> >
> > Sometimes I am a few User Menus deep in my application and 
> I start pressing
> > "X" to  back out, sometimes I hit "X" one too many times 
> and actually back
> > out of the MAIN MENU (and then exits me from the login).
> >
> >
> >
> > Is there any practical way to put a confirmation on just my 
> main menu, so
> > when you press "X" it asks you for to confirm that  you 
> want to exit?
> >
> >    
> 
> Make your main menu a clerk processing menu.
> 
> Bill
> 
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
> 



More information about the Filepro-list mailing list