How to detect a "closed object"

10 views
Skip to first unread message

Rex Swain

unread,
Apr 22, 2020, 6:56:05 PM4/22/20
to APLWin
When closing an APL+Win application, I sometimes get an error like this

⎕WI ACTION ERROR: Cannot invoke method "AutoFit" for closed object
'lv' ⎕wi 'AutoFit' 'header' 'all' 

In this case, 'lv' is a Listview object.  But sometimes it happens to other classes. 

Question:  How can I query beforehand an object is "closed"?  
I thought the 'opened' property might be a clue, but it does no seem to be (it returns 1).  
Any suggestions?

Ajay Askoolum

unread,
Apr 23, 2020, 10:34:11 AM4/23/20
to APLWin
I haven't used these controls in years - so take this with a pinch of salt.

The 'opened' property is read only; it changes to 0 after executing the 'Close' method after which I can create your error. 

The only suggestion I have is that you execute your code inside an onOpen event..
Reply all
Reply to author
Forward
0 new messages