Localizing ODCL event AutoLisp function names.

Started by Kerry, December 16, 2014, 02:31:43 PM

Previous topic - Next topic

Kerry

[search comment]  localize = localise


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


(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,
Perfection is not optional.
My other home is TheSwamp

owenwengerd

See the Style Guidelines 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.
Owen Wengerd (Outside The Box) / ManuSoft

Kerry

Perfection is not optional.
My other home is TheSwamp