[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

182.0. "Need way to confirm ending data entry on EXIT SCREEN" by SANFAN::LESLIE_DA (Greetings & Solutions) Thu Mar 05 1992 23:22

    At my current customer site, they are interrested in modifying the
    action of the exit screen keys when they are in add or change mode on
    an entry form.  Basically, they'd like to confirm that the user really
    wants to stop processing (and lose all the data) when they press EXIT
    SCREEN.
    
    Functionality similar to the /ONE_ENTRY form qualifier when completing
    the form.
    
    In other words...
    
    It would be nice to have an entry form qualifier called /EXIT_CONFIRM
    which would prompt the user to confirm the exit.
    
    I recognize that the qualifier would only be available in some distant
    version of ALL-IN-1 (if ever ;^), and the customer would like to do
    something now...
    
    Has anyone done this?  We've tried a couple of different hacks on the
    GOLD Q named data on an entry form, but nothing worked smoothly and
    cleanly.  My plan was to modify the default named data for the 4 keys
    that perform oa$fld_exit to:
    	1. Detect change or add mode and verify entry form
    	2. Do oa$fld_exit in all other cases
    	3. Make the user confirm the EXIT (by pressing RETURN)
    	4. Either do oa$fld_exit, or return to the form
    
    The code we wrote worked well using .SINGLE to retrieve any key from
    the user.  The problem came when a keypad key (like EXIT SCREEN or ->)
    was pressed.  In those cases, extra characters were written to the
    screen.
    
    Our named data looked as follows:
    
;;.KEY 0;;

 .if oa$form_type nes "ENTRY" or
  oa$entry_form_mode eq 4 then oa$fld_exit \ifexit
 \.single 23,1,
  "Press Y to exit without saving, or any other key to continue . . ."
 \get #custom_exit = oa$script_psib
 \.if #custom_exit eqs "Y" then oa$fld_exit \ifexit
 \.if #custom_exit eqs "{SPACE}" then .single 23,1,"" \\.single 23,1,""
 \force \.refresh 23,1

     Thanks in advance,
Dan
T.RTitleUserPersonal
Name
DateLines
182.1A suggestionSCOTTC::MARSHALLPearl-white, but slightly shop-soiledFri Mar 06 1992 14:236
Hi,

Try using YESNO_PROMPT and checking OA$PROMPT_TEXT and/or OA$PROMPT_DISPOSE,
instead of SINGLE.

Scott
182.2We're planning to try disabling/enabling application keypad modeSANFAN::LESLIE_DAGreetings & SolutionsFri Mar 06 1992 21:407
    Thanks, Scott, but YESNO_PROMPT requires a character confirmation
    (Y<CR>).  I believe we're going to reset the keypad to numeric get the
    character then reset to application keypad.  This may still cause
    problems if one of the arrow keys is pressed, but we'll see...
    
    Thanks for (any/the) interest...
Dan
182.3Non-app KP0 = "0"IOSG::TALLETTMit Schuh bish hiMon Mar 09 1992 08:048
    
    	I'm not sure what the keypad resetting is supposed to acheive,
    	but in non-application mode, KP0 generates ASCII "0" which isn't
    	a terminator character so you won't be able to see it until
    	the user types <RETURN> or something.
    
    Regards,
    Paul
182.4PROMPTUTRTSC::BOSMANWe&#039;re just sugar mice in the rainMon Mar 09 1992 08:277
    Dan,
    
    You also could use PROMPT and test OA$FORM_TERMINATOR and
    OA$PROMPT_TEXT. One may press RETURN on PROMPT without giving any
    input.
    
    Sjaak.
182.5Looks like PROMPT is the only way to go . . .SANFAN::LESLIE_DAGreetings &amp; SolutionsTue Mar 10 1992 03:4410
    RE: -.2 .PROMPT is a script directive and responds when a single
    	    character is pressed.  The arrow keys cause the same problem as
    	    the keypad keys, so sing umeric keypad buys me little.
    
    RE: -.1 I was hoping to avoid using PROMPT to do this, but it appears
    	    that this is the only way to do what I want (without the new
    	    form qualifier that is).
    
    Thanks for the ideas...
Dan
182.6does it?SHALOT::GEERDESThu Mar 12 1992 21:134
My script containing the following line does not seem to have any 
extra characters generated, whatever key I press.

.SINGLE 23,1,"ABC"
182.7IBM PC running reflection . . .SANFAN::LESLIE_DAGreetings &amp; SolutionsFri Mar 13 1992 06:127
    Ben,
    
    The user is running Reflection on an IBM PC and they keys do indeed
    generate the extra characters.  The first one looks like a {SPACE}.
    
    I plan to implement something tomorrow...
Dan
182.8Macy's West' mechanism . . .SANFAN::LESLIE_DAGreetings &amp; SolutionsFri Apr 10 1992 20:0076
    
    Here's the way we implemented this functionality at Macy's West.  The
    following named data is from the form MACYS_MORE_EXIT_KEYS.  It makes
    you enter Y to really exit (kind of like WPS-PLUS).
    
    Enjoy...
Dan

;;~~EXIT SCREEN KEYS COMMENTS~~;;

.remarks The key definitions used here enable the application developer to
         obtain confirmation from the user about leaving an entry form when they
         press one of the EXIT SCREEN keys.  In order to use these key
         definitions, the following must be done:
   1. A /pre_function='xop "~~MACYS_EXIT_PRE~~"' must be placed in the .TYPE
      form directive
   2. This form (MACYS_MORE_EXIT_KEYS) must be placed on the .MORE form
      directive
   3. The entry form must not specify named data code for the following keys:
      CR, ENTER, GOLD F, KEY 0, GOLD K, GOLD Q, or F10.  These definitions are
      defined in this section

;;.CR;;

xop "~~MACYS_CR~~"

;;.ENTER;;

xop "~~MACYS_CR~~"

;;.GOLD F;;

xop "~~MACYS_CR~~"

;;.KEY 0;;

xop "~~MACYS_KEY_0~~"

;;.GOLD K;;

xop "~~MACYS_KEY_0~~"

;;.GOLD Q;;

xop "~~MACYS_KEY_0~~"

;;.F10;;

xop "~~MACYS_KEY_0~~"

;;~~MACYS_EXIT_PRE~~;;

get #MACYS_EXIT = ""

;;~~MACYS_CR~~;;

.if not ("1,2" <=> oa$entry_form_mode) then oa$fld_done
  else xop "~~MACYS_DONE~~"

;;~~MACYS_DONE~~;;

.if (#MACYS_EXIT eqs "" or #MACYS_EXIT eqs "CR") then
 get #MACYS_EXIT="CR" \\oa$fld_done else oa$fld_stay

;;~~MACYS_KEY_0~~;;

  .if not ("1,2" <=> oa$entry_form_mode) then oa$fld_exit \ifexit
 \.if #MACYS_EXIT eqs "CR" then get #MACYS_EXIT = "" \\oa$fld_exit \ifexit
 \xop "~~MACYS_EXIT_PROMPT~~"

;;~~MACYS_EXIT_PROMPT~~;;

  .clear 24,1  \get oa$display="Press Y to end without saving your changes: "
 \force \.single 24,45,"" \.if oa$script_text eqs "Y" then
  get #MACYS_EXIT="" \\oa$fld_exit else .refresh 24,1 \\oa$fld_stay