Help With PUSH Command

David Frederick (714)969-4600 x4109 David_Frederick@WYCLIFFE.ORG
Wed, 21 Jan 1998 23:32:18 +0000 (GMT)


On 21-Jan-1998 owner-powerh-l@sphere.swau.edu wrote:

>I have a QUICK screen (Alpha - 7.10F3) where I'm doing some special
>processing. For the sake of clarity I've removed all the code to keep it as
>simple as possible. Here is what I have:
>
>
>...... snip
>
>ACTIONMENU LABEL "Update " 
>  MENUITEM LABEL "Update and Continue" ACTION UPDATE STAY
>  MENUITEM LABEL "Finalize Only" ACTION DESIGNER DES1
>  MENUITEM LABEL "Update and Finalize" ACTION DESIGNER DES2
>...... snip
>
>PROCEDURE DESIGNER DES1
>BEGIN
>  DO INTERNAL FINALIZE
>END
>
>PROCEDURE DESIGNER DES2
>BEGIN
>  PUSH UPDATE STAY
>  DO INTERNAL FINALIZE
>END
>
>
>
>
>After I go through the normal entry sequence and return to the menubar, If
>I execute the FIRST menuitem "Update and Continue", then execute the SECOND
>menuitem "Finalize Only", everything works just as I want it to. If I
>choose the THIRD menuitem though, I'm not getting the same results (seems
>the buffers are getting cleared, or something, and I get a duplicate key
>error...)
>
>My question is why doesn't it work as "one step" when I can do it as two
>steps and it works ok?
>
>Thanks!
>
>
>Terry Pickering    	    		CompuGroup, Inc.
>pickering@myself.com	    		Portland, Oregon USA
>www.teleport.com/~compugrp 		Cessna 172 & Lancair ES
>   
>   	    	    	       __!__          
>   	    	    	 _______(*)_______    
>   	    	    	     !   !   !        
>
>

It's been a looong time since I've worked with this, but from what I remember, 
the stuff on the PUSH verb will not actually execute until the screen is ready 
to give control back to the the user again.  In your case, that won't occur 
until after the designer procedure has executed.

In short, if the above explanation is correct, the DO INTERNAL FINALIZE is 
executing before the PUSH UPDATE STAY.

I'm not 100% sure, but the following should work:

PROCEDURE DESIGNER DES2
BEGIN
  PUSH DESIGNER DES1, UPDATE STAY
END

When the user uses the DES2 designer procedure, it will put "DESIGNER DES1" and 
then "UPDATE STAY" in the push buffer (or whatever it's called) and will execute 
both commands sequentially as if the user chose those options.

Another thing worth noting... if you do the above using separate PUSH commands, 
I believe you have to place them in reverse order as, from what I remember, the 
push buffer is LIFO.

Thanks,
David Frederick
Programmer/Analyst
Wycliffe Bible Translators USA
Internet:  David.Frederick@wycliffe.org
----
Disclaimer: Opinions expressed may not reflect those of my employer.