Answered Window-close trigger

Hello everyone,

Is it possible to abord the window-close trigger like that:

Code:
DO:
    DEFINE VARIABLE lChoice AS LOGICAL     NO-UNDO.
  /* This ADM code must be left here in order for the SmartWindow
     and its descendents to terminate properly on exit. */
    
    MESSAGE "Are you willing to close this application"
        VIEW-AS ALERT-BOX INFO BUTTONS YES-NO UPDATE lChoice.
    
    IF NOT lChoice THEN RETURN.
    
    APPLY "CLOSE":U TO THIS-PROCEDURE.
    RETURN NO-APPLY.
 

END.

Because the code I write above doesn't work. If i refused by clicking No on the message box my "lChoice" variable is at false but the window is still closing on a debug mode.

Is it even possible ? I think I'm not doing it the right way.

Thanks in advance as always :)

Best Regards,

- Vivien -
 

andre42

Member
I suppose you mean "to abort the window-close trigger"?
Where is this do-block located? Already in the "on window-close of" trigger?
If this is your window-close trigger, you will need "return no-apply" instead of "return" when you want to abort the trigger.
 
Top