Returning to the called program

jgress

New Member
I have a simple question. I have a .p that calls another .p. In the called program I have a quit button, but when the user clicks on the buttons although it fires it does not return to the calling program. Instead it clears out the browser and just sits there saying at the bottom of the screen "Enter data or press ESC to end." When I hit ESC the buttons are no longer lit up but it does not end until I close the window, which does not go back to the calling program either.

I had a close query in there too but it did nothing. At this point all I have is this.
ON CHOOSE OF button2 IN FRAME f2
DO:
PAUSE 0 BEFORE-HIDE.
RETURN.
END.

This is in version 12.3. I know quit is supposed to bring it back to the O.S. so I am using return. Stop does not work either. Any suggestions?
 

TomBascom

Curmudgeon
A trigger is, essentially, an internal procedure. The RETURN in your trigger is exiting the trigger and returning control to whatever caused it to be called. In GUI code that is usually a WAIT-FOR or another trigger.
 

jgress

New Member
Nothing seems to be working.
ON CHOOSE OF button2 IN FRAME f2
DO:
APPLY "CLOSE":U TO CURRENT-WINDOW.
END.


WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW OR "CHOOSE" OF button2.
MESSAGE "past window-close" VIEW-AS ALERT-BOX.
APPLY "CLOSE" TO THIS-PROCEDURE.

/*RETURN NO-APPLY.*/

I tried the apply close to this-procedure in the exit button and it did not work. I thought about what Tom said and added a message after the wait-for window-close and even added or "CHOOSE" of button2 there. I get the message "Past Window Close" but it still does not exit the application. It disables the button and looks dead but this frame is still visible on the screen and if I close the window by hitting the X at the top of the window it does not return to the calling program - which I did not expect it to. I did put a quit statement in there and it took me back to the procedure so it is executing the code, just not returning to the calling program. This is crazy.
 

TomBascom

Curmudgeon
Not that I am going to rush out and try my hand at Windows GUI coding tonight but It is rather difficult to have an opinion about how to fix the situation without seeing a complete, reproducible, (un)working example.
 

jgress

New Member
It looks like I have it returning now but have a different problem. The screen on the calling program is blank. I simply had a run statement on there and I've now done a hide all no-pause on the called program and put a message into the calling program that says "I'm back!" but the screen is completely blank for some reason. I feel like I'm running into every possible problem here. So odd.
 
Top