Sam Jones Posted May 26, 2020 Share Posted May 26, 2020 Is there an event that is generated when a PIO is deleted? Can this event be trapped and routines run before the completion of the deletion? Quote Link to comment
JBenghiat Posted May 27, 2020 Share Posted May 27, 2020 Yes, but I’m fairly sure not with vs. Quote Link to comment
Sam Jones Posted May 27, 2020 Author Share Posted May 27, 2020 In other words, no. Oh well. It would have allowed for a lot of very desirable cleaning up for those PIOs that go around spreading information about themselves. It doesn't seem like it would be a big stretch to implement since OnDeleteDelete is already implemented. 1 Quote Link to comment
MullinRJ Posted May 27, 2020 Share Posted May 27, 2020 Sam, This is not a definitive answer, and I've only played with it for a few minutes, but you may want to see if this gets you close enough so you can do your dastardly deeds. Do you need to make a distinction between your Plug-in being CUT vs. DELETED? If so, then stop reading HERE, as this won't help you. If not, then try adding a line at the end of your 44 event (kObjOnAddState) to test the state of "theButton" variable that's returned from the first line in the 44 event. It's going to take some sussing out on your part to see if it meets your needs. If you only get the 'Am I DeLETeD?' message when you expect it, then substitute the AlrtDialog() call with your cleanup procedure. vsoGetEventInfo(theEvent, theButton); case theEvent of ... kObjOnAddState: begin { 44 } theButton := vsoStateAddCurrent(PIOHand, theButton); if (theButton = 14) then AlrtDialog(concat('Am I DeLETeD?')); end; { 44 } end; { case } HTH, Raymond 2 Quote Link to comment
Sam Jones Posted May 27, 2020 Author Share Posted May 27, 2020 Raymond, Preliminary testing seems to show that this works wonderfully. I still have some extensive testing of the cleanup routine to be sure I can do everything I need to do, but there doesn't seem to be any reason why I could not. Thank you so much !! Quote Link to comment
MullinRJ Posted May 27, 2020 Share Posted May 27, 2020 You're welcome, Sam. Sometimes I get lucky. Raymond Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.