OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: ScottBolton on December 01, 2015, 06:28:00 AM

Title: How to delete unwanted events
Post by: ScottBolton on December 01, 2015, 06:28:00 AM
In my Splash exercise I create a c:splash/Form1#OnTimer event. Once my splash screen has disappeared that function is still available - how do I remove it?
Title: Re: How to delete unwanted events
Post by: Fred Tomke on December 01, 2015, 06:52:29 AM
Hi, in modal forms I place the events in the private symbol list of the defun:
Code (autolisp) Select
(defun c:mytest (/ c:splash/Form1#OnTimer) ... )

In modeless forms you can set the symbols to nil manually.
Code (autolisp) Select
(setq c:splash/Form1#OnTimer nil)

Regards, Fred
Title: Re: How to delete unwanted events
Post by: ScottBolton on December 01, 2015, 08:25:18 AM
Hi Fred.  I'd tried both methods but get the message ; error: no function definition: C:SPLASH/FORM1#ONTIMER.

My modeless code is:

(dcl-Project-Load "splash.odcl" nil)
(dcl-Form-Show splash/Form1)
(dcl-Form-StartTimer splash/Form1 5000)
(defun c:splash/Form1#OnTimer ()
  (dcl-Project-Unload "splash" T)
  (princ)
  )

Presumably I'm setting c:splash/Form1#OnTimer to nil before the 5 seconds has elapsed.