Page 1 of 1

Stop code on window

Posted: Sun Mar 24, 2019 2:58 am
by shark
is it possible stop running a code until a window is closed ? (WAIT)

ex:

CODE...

DEFINE WINDOW oWnd TITLE "Test"
...
...
ACTIVATE WINDOW oWnd MAXIMIZED (STOP HERE...)

CONTINUE CODE...

Re: Stop code on window

Posted: Sun Mar 24, 2019 9:32 am
by Marc Vanzegbroeck
Do you mean something like a dialog?

Re: Stop code on window

Posted: Sun Apr 28, 2019 8:23 pm
by shark
Yes... I want code stoped like a dialog

Re: Stop code on window

Posted: Mon Apr 29, 2019 10:04 am
by nageswaragunupudi
If the window is a main window, the "CONTINUE CODE" is not executed till the window is closed.

Are you asking about an MDI Child window?

Re: Stop code on window

Posted: Mon Apr 29, 2019 3:44 pm
by nageswaragunupudi
1) Main Window
The "CONTINUE CODE" is executed only after the main window is closed.

2) MDI Child Window:

Do not put the CONTINUE CODE after ACTIVATE WINDOW, but put this code in the codeblock

Code: Select all

oWnd:bPostEnd := { || <CONTINUE CODE> }

3) Normal window, but not a main window or mdi child window.

[code]
local lExit := .f.

// other code

ACTIVATE WINDOW oWnd VALID ( lExit := .t. )
StopUntil( { || lExit } )

CONTINUE CODE