Localizing ODCL event AutoLisp function names.

Started by Kerry Brown · 2014-12-16 22:31 UTC · 2 replies · SMF topic #2221

[search comment]  localize = localise


Should/can Autolisp Event function names be localized ?
Is there a definitive article somewhere regarding this.
ie:


(defun c:doit( /
                    *error*
                      c:3D-Plate/F#OnInitialize
                      ;; variables
                      local-varThingy

                    )
  (defun c:3D-Plate/F#OnInitialize (/)
    (dcl-MessageBox "To Do: code must be added to event handler\r\nc:3D-Plate/F#OnInitialize" "To do")
  )

  (princ)
)
(princ)


Any specific recommendations, warnings, best practice

Regards,
See the {2} section in the documentation. The samples are intended to demonstrate the best practice. They *can* be localized as long as you're certain that they will be defined when they are fired, but I don't recommend it. For one, it causes a performance hit. Second, it's easy for newbies to get tripped up and end up with events firing after the handler has already gone out of scope.

Thanks Owen. I'll have a read tonight.