Applies to: posted in the Clarion 8 group; ABC Window procedure (not a Form procedure).
Problem
A simple window has two global variables that must be set and saved to an INI file when the user accepts. Code in the TakeCompleted embed and in the OK button's Accepted embed never ran, even a MESSAGE() did not show. Code in Init worked. A MESSAGE() in the button's All Events embed fired before the click (events 257 and 258) and after the click the window closed silently. The poster also needed to know whether the user accepted or not.
Solution
- A form template sets the OK control in Init, with
SELF.OkControl = ?OK. TakeCompleted is only called when the OK button is the window's OkControl. - The chain is: TakeAccepted calls PostCompleted when the OkControl was accepted, PostCompleted posts Event:Completed, and TakeEvent then calls TakeCompleted. Find where this chain breaks for your window.
- What worked for the original poster: in the Kill method, before the window closes, test which control was last selected. If it is the OK button, write the variables. The poster set
SELF.OkControl = ?OkButtonin Init earlier without effect, and did not explain why. - If the aim is only to keep global values, a poster suggested marking the globals as preserved.
Caveats
- The thread never says why the OkControl assignment had no effect.
- The Kill test treats "last selected control" as "accepted"; it does not catch an accept by another key.
Today (2026)
Not re-tested. The method chain is from the ABC classes of that era and may be the same today.
Sources: Djordje R. (May 2012, the question), Abe J., Jon W. (May 2012) in sv.clarion.clarion8.